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

  • New post: This week we’ll take a look at a new version of FormBuilder that's on the way (with a screencast), as well as the latest version of the core: ProcessWire 3.0.140— More
    6 September 2019
  • We added WebP image support this year and many have been adopting it in existing projects. We look at a process used for migrating existing websites to WebP images— from preliminary considerations to implementation & testing, w/lots of tips & tricks too: More
    16 August 2019
  • Core version 3.0.137 on the dev branch adds the ability to hook multiple methods at once, in a single call. This post details how it works and provides a useful example of how you might put it to use in your development environment— More
    2 August 2019

Latest news

  • ProcessWire Weekly #279
    This week in the 279th issue of ProcessWire Weekly we're going to introduce some of the latest third party modules out there, and highlight a brand new site of the week. Read on!
    Weekly.pw / 14 September 2019
  • ProcessWire 3.0.140 and FormBuilder v40
    This week we’ll take a look at a new version of FormBuilder that's on the way (with a screencast), as well as the latest version of the core: ProcessWire 3.0.140.
    Blog / 6 September 2019
  • Subscribe to weekly ProcessWire news

“We were really happy to build our new portfolio website on ProcessWire! We wanted something that gave us plenty of control on the back-end, without any bloat on the front end - just a nice, easy to access API for all our content that left us free to design and build however we liked.” —Castus, web design agency in Sheffield, UK