diff --git a/lib/Pico.php b/lib/Pico.php index 7634206abf1b38be51839530fab7242a7aa80830..b9d5f9d0a8882c7c3526de12175caea23f4acb25 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -145,6 +145,14 @@ class Pico */ protected $rawContent; + /** + * Boolean indicating whether Pico is serving a 404 page + * + * @see Pico::is404Content() + * @var boolean + */ + protected $is404Content = false; + /** * Meta data of the page to serve * @@ -322,6 +330,7 @@ class Pico header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); $this->rawContent = $this->load404Content($this->requestFile); + $this->is404Content = true; $this->triggerEvent('on404ContentLoaded', array(&$this->rawContent)); } @@ -866,6 +875,17 @@ class Pico return $this->rawContent; } + /** + * Returns TRUE when Pico is serving a 404 page + * + * @see Pico::load404Content() + * @return boolean TRUE if Pico is serving a 404 page, FALSE otherwise + */ + public function is404Content() + { + return $this->is404Content; + } + /** * Returns known meta headers and triggers the onMetaHeaders event *