Skip to content

Javascript helper functions

Eugene Min edited this page Apr 17, 2016 · 4 revisions

trans(key)

  • @param key String

Translate item by key (only works with pre-defined inputs in mconsole::partials.trans Blade view):

Blade:

@include('mconsole::partials.trans', [
    'lang' => [
        'foo' => 'bar',
    ],
])

Javascript:

var value = trans('foo');

notification(type, text, title)

  • @param type String
  • @param text String
  • @param title String

Show toastr notification one of these types (success, info, warning, error)


Clone this wiki locally