Add Pico::is404Content() method

This commit is contained in:
Daniel Rudolf 2016-11-26 16:48:10 +01:00
parent d6a094216b
commit 0a269746eb
No known key found for this signature in database
GPG key ID: A061F02CD8DE4538

View file

@ -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
*