Add Pico::is404Content() method
This commit is contained in:
parent
d6a094216b
commit
0a269746eb
20
lib/Pico.php
20
lib/Pico.php
@ -145,6 +145,14 @@ class Pico
|
|||||||
*/
|
*/
|
||||||
protected $rawContent;
|
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
|
* Meta data of the page to serve
|
||||||
*
|
*
|
||||||
@ -322,6 +330,7 @@ class Pico
|
|||||||
|
|
||||||
header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
|
header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
|
||||||
$this->rawContent = $this->load404Content($this->requestFile);
|
$this->rawContent = $this->load404Content($this->requestFile);
|
||||||
|
$this->is404Content = true;
|
||||||
|
|
||||||
$this->triggerEvent('on404ContentLoaded', array(&$this->rawContent));
|
$this->triggerEvent('on404ContentLoaded', array(&$this->rawContent));
|
||||||
}
|
}
|
||||||
@ -866,6 +875,17 @@ class Pico
|
|||||||
return $this->rawContent;
|
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
|
* Returns known meta headers and triggers the onMetaHeaders event
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user