Message · Mecha CMS

Messages.

__callStatic()

Author: Taufik Nurrohman · 211 Views

Tweet

Dynamic methods.

If no kin was defined, this method will function as a shortcut for Message::get().

Message::{$any}($text, $vars = [], $preserve_case = false);

Example:

Message::error('create');
Message::info('create');
Message::success('create');
Message::warning('create');

Message::foo('create');
Message::bar('create');

Note: Calling Message::error() and Message::warning() will increase the internal Message::$x value. This is useful for checking errors before doing something:

if (!Message::$x) {
    File::write('test')->saveTo('success.log');
}