Add onSinglePageContent event
This commit is contained in:
parent
773f4795f7
commit
d26da62bf1
|
@ -1378,6 +1378,9 @@ class Pico
|
||||||
if ($file !== $this->requestFile) {
|
if ($file !== $this->requestFile) {
|
||||||
$rawContent = $this->loadFileContent($file);
|
$rawContent = $this->loadFileContent($file);
|
||||||
|
|
||||||
|
// trigger onSinglePageContent event
|
||||||
|
$this->triggerEvent('onSinglePageContent', array($id, &$rawContent));
|
||||||
|
|
||||||
$headers = $this->getMetaHeaders();
|
$headers = $this->getMetaHeaders();
|
||||||
try {
|
try {
|
||||||
$meta = $this->parseFileMeta($rawContent, $headers);
|
$meta = $this->parseFileMeta($rawContent, $headers);
|
||||||
|
|
|
@ -232,6 +232,7 @@ class DummyPlugin extends AbstractPicoPlugin
|
||||||
*
|
*
|
||||||
* @see Pico::readPages()
|
* @see Pico::readPages()
|
||||||
* @see DummyPlugin::onSinglePageLoading()
|
* @see DummyPlugin::onSinglePageLoading()
|
||||||
|
* @see DummyPlugin::onSinglePageContent()
|
||||||
* @see DummyPlugin::onSinglePageLoaded()
|
* @see DummyPlugin::onSinglePageLoaded()
|
||||||
* @see DummyPlugin::onPagesDiscovered()
|
* @see DummyPlugin::onPagesDiscovered()
|
||||||
* @see DummyPlugin::onPagesLoaded()
|
* @see DummyPlugin::onPagesLoaded()
|
||||||
|
@ -247,6 +248,7 @@ class DummyPlugin extends AbstractPicoPlugin
|
||||||
*
|
*
|
||||||
* Set `$id` to `null` to remove this page from the pages array.
|
* Set `$id` to `null` to remove this page from the pages array.
|
||||||
*
|
*
|
||||||
|
* @see DummyPlugin::onSinglePageContent()
|
||||||
* @see DummyPlugin::onSinglePageLoaded()
|
* @see DummyPlugin::onSinglePageLoaded()
|
||||||
* @see DummyPlugin::onPagesDiscovered()
|
* @see DummyPlugin::onPagesDiscovered()
|
||||||
* @see DummyPlugin::onPagesLoaded()
|
* @see DummyPlugin::onPagesLoaded()
|
||||||
|
@ -258,6 +260,25 @@ class DummyPlugin extends AbstractPicoPlugin
|
||||||
// your code
|
// your code
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Triggered when Pico loads the raw contents of a single page
|
||||||
|
*
|
||||||
|
* Please note that this event isn't triggered when the currently processed
|
||||||
|
* page is the requested page. The reason for this exception is that the
|
||||||
|
* raw contents of this page were loaded already.
|
||||||
|
*
|
||||||
|
* @see DummyPlugin::onSinglePageLoaded()
|
||||||
|
* @see DummyPlugin::onPagesDiscovered()
|
||||||
|
* @see DummyPlugin::onPagesLoaded()
|
||||||
|
* @param string $id relative path to the content file
|
||||||
|
* @param string &$rawContent raw file contents
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function onSinglePageContent($id, &$rawContent)
|
||||||
|
{
|
||||||
|
// your code
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Triggered when Pico loads a single page
|
* Triggered when Pico loads a single page
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue