Wire::warning() method

Record a warning error message in the system-wide notices.

This method automatically identifies the warning as coming from this class.

Example

$this->warning("This is the notice text");
$this->warning("This notice is also logged", true);
$this->warning("This notice is only shown in debug mode", Notice::debug);
$this->warning("This notice allows <em>markup</em>", Notice::allowMarkup);
$this->warning("Notice using multiple flags", Notice::debug | Notice::logOnly);

Usage

// basic usage
$wire->warning($text);

// usage with all arguments
$wire->warning($text, $flags = 0);

Arguments

NameType(s)Description
textstring, array, Wire

Text to include in the notice

flags (optional)int, bool

Optional flags to alter default behavior:

  • Notice::debug (constant): Indicates notice should only be shown when debug mode is active.
  • Notice::log (constant): Indicates notice should also be logged.
  • Notice::logOnly (constant): Indicates notice should only be logged.
  • Notice::allowMarkup (constant): Indicates notice should allow the use of HTML markup tags.
  • true (boolean): Shortcut for the Notice::log constant.

Return value

$this

Object instance it was called from (method supports fluent interface).

See Also


Wire methods and properties

API reference based on ProcessWire core version 3.0.137

Twitter updates

  • ProcessWire 3.0.144 and 3.0.145 add improved field template context override settings and include a new Inputfields API, along with numerous other issue fixes, optimizations and improvements to the core. More
    8 November 2019
  • ProcessWire 3.0.144 core updates: Upgraded overrides section in the field editor, a new Inputfields JS API, and more— More
    1 November 2019
  • ProcessWire 3.0.143 core updates — 26 commits and 18 resolved issue reports, plus some other useful improvements and additions. More here: More
    25 October 2019

Latest news

  • ProcessWire Weekly #288
    In the 288th issue of ProcessWire Weekly we'll cover the latest core updates, introduce WireMailSendGrid, host a new weekly poll, and showcase a new site of the week. Read on!
    Weekly.pw / 16 November 2019
  • ProcessWire 3.0.145 core updates
    ProcessWire 3.0.144 and 3.0.145 add improved field template context override settings and include a new Inputfields API, along with numerous other issue fixes, optimizations and improvements to the core.
    Blog / 8 November 2019
  • Subscribe to weekly ProcessWire news

“We chose ProcessWire because of its excellent architecture, modular extensibility and the internal API. The CMS offers the necessary flexibility and performance for such a complex website like superbude.de. ProcessWire offers options that are only available for larger systems, such as Drupal, and allows a much slimmer development process.” —xport communication GmbH