Merge pull request #234 from kushipl/master

Apply PSR1/PSR2 coding standards.
pico-3.0-alpha
Tyler Heshka 10 years ago
commit 6e50ac5cc8
  1. 16
      index.php
  2. 742
      lib/pico.php
  3. 165
      plugins/pico_plugin.php

@ -1,13 +1,13 @@
<?php <?php
define('ROOT_DIR', realpath(dirname(__FILE__)) .'/'); define('ROOT_DIR', realpath(dirname(__FILE__)) . '/');
define('CONTENT_DIR', ROOT_DIR .'content-sample/'); define('CONTENT_DIR', ROOT_DIR . 'content-sample/');
define('CONTENT_EXT', '.md'); define('CONTENT_EXT', '.md');
define('LIB_DIR', ROOT_DIR .'lib/'); define('LIB_DIR', ROOT_DIR . 'lib/');
define('PLUGINS_DIR', ROOT_DIR .'plugins/'); define('PLUGINS_DIR', ROOT_DIR . 'plugins/');
define('THEMES_DIR', ROOT_DIR .'themes/'); define('THEMES_DIR', ROOT_DIR . 'themes/');
define('CACHE_DIR', LIB_DIR .'cache/'); define('CACHE_DIR', LIB_DIR . 'cache/');
require_once(ROOT_DIR .'vendor/autoload.php'); require_once(ROOT_DIR . 'vendor/autoload.php');
require_once(LIB_DIR .'pico.php'); require_once(LIB_DIR . 'pico.php');
$pico = new Pico(); $pico = new Pico();

@ -8,360 +8,394 @@
* @license http://opensource.org/licenses/MIT * @license http://opensource.org/licenses/MIT
* @version 0.8 * @version 0.8
*/ */
class Pico { class Pico
{
private $config;
private $plugins; private $config;
private $plugins;
/**
* The constructor carries out all the processing in Pico. /**
* Does URL routing, Markdown processing and Twig processing. * The constructor carries out all the processing in Pico.
*/ * Does URL routing, Markdown processing and Twig processing.
public function __construct() */
{ public function __construct()
// Load plugins {
$this->load_plugins(); // Load plugins
$this->run_hooks('plugins_loaded'); $this->load_plugins();
$this->run_hooks('plugins_loaded');
// Load the settings
$settings = $this->get_config(); // Load the settings
$this->run_hooks('config_loaded', array(&$settings)); $settings = $this->get_config();
$this->run_hooks('config_loaded', array(&$settings));
// Get request url and script url
$url = ''; // Get request url and script url
$request_url = (isset($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : ''; $url = '';
$script_url = (isset($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : ''; $request_url = (isset($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : '';
$script_url = (isset($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : '';
// Get our url path and trim the / of the left and the right
if($request_url != $script_url) $url = trim(preg_replace('/'. str_replace('/', '\/', str_replace('index.php', '', $script_url)) .'/', '', $request_url, 1), '/'); // Get our url path and trim the / of the left and the right
$url = preg_replace('/\?.*/', '', $url); // Strip query string if ($request_url != $script_url) {
$this->run_hooks('request_url', array(&$url)); $url = trim(preg_replace('/' . str_replace('/', '\/', str_replace('index.php', '', $script_url)) . '/', '',
$request_url, 1), '/');
// Get the file path }
if($url) $file = $settings['content_dir'] . $url; $url = preg_replace('/\?.*/', '', $url); // Strip query string
else $file = $settings['content_dir'] .'index'; $this->run_hooks('request_url', array(&$url));
// Load the file // Get the file path
if(is_dir($file)) $file = $settings['content_dir'] . $url .'/index'. CONTENT_EXT; if ($url) {
else $file .= CONTENT_EXT; $file = $settings['content_dir'] . $url;
} else {
$this->run_hooks('before_load_content', array(&$file)); $file = $settings['content_dir'] . 'index';
if(file_exists($file)){ }
$content = file_get_contents($file);
} else { // Load the file
$this->run_hooks('before_404_load_content', array(&$file)); if (is_dir($file)) {
$content = file_get_contents($settings['content_dir'] .'404'. CONTENT_EXT); $file = $settings['content_dir'] . $url . '/index' . CONTENT_EXT;
header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found'); } else {
$this->run_hooks('after_404_load_content', array(&$file, &$content)); $file .= CONTENT_EXT;
} }
$this->run_hooks('after_load_content', array(&$file, &$content));
$this->run_hooks('before_load_content', array(&$file));
$meta = $this->read_file_meta($content); if (file_exists($file)) {
$this->run_hooks('file_meta', array(&$meta)); $content = file_get_contents($file);
} else {
$this->run_hooks('before_parse_content', array(&$content)); $this->run_hooks('before_404_load_content', array(&$file));
$content = $this->parse_content($content); $content = file_get_contents($settings['content_dir'] . '404' . CONTENT_EXT);
$this->run_hooks('after_parse_content', array(&$content)); header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
$this->run_hooks('content_parsed', array(&$content)); // Depreciated @ v0.8 $this->run_hooks('after_404_load_content', array(&$file, &$content));
}
// Get all the pages $this->run_hooks('after_load_content', array(&$file, &$content));
$pages = $this->get_pages($settings['base_url'], $settings['pages_order_by'], $settings['pages_order'], $settings['excerpt_length']);
$prev_page = array(); $meta = $this->read_file_meta($content);
$current_page = array(); $this->run_hooks('file_meta', array(&$meta));
$next_page = array();
while($current_page = current($pages)){ $this->run_hooks('before_parse_content', array(&$content));
if((isset($meta['title'])) && ($meta['title'] == $current_page['title'])){ $content = $this->parse_content($content);
break; $this->run_hooks('after_parse_content', array(&$content));
} $this->run_hooks('content_parsed', array(&$content)); // Depreciated @ v0.8
next($pages);
} // Get all the pages
$prev_page = next($pages); $pages = $this->get_pages($settings['base_url'], $settings['pages_order_by'], $settings['pages_order'],
prev($pages); $settings['excerpt_length']);
$next_page = prev($pages); $prev_page = array();
$this->run_hooks('get_pages', array(&$pages, &$current_page, &$prev_page, &$next_page)); $current_page = array();
$next_page = array();
// Load the theme while ($current_page = current($pages)) {
$this->run_hooks('before_twig_register'); if ((isset($meta['title'])) && ($meta['title'] == $current_page['title'])) {
Twig_Autoloader::register(); break;
$loader = new Twig_Loader_Filesystem(THEMES_DIR . $settings['theme']); }
$twig = new Twig_Environment($loader, $settings['twig_config']); next($pages);
$twig->addExtension(new Twig_Extension_Debug()); }
$twig_vars = array( $prev_page = next($pages);
'config' => $settings, prev($pages);
'base_dir' => rtrim(ROOT_DIR, '/'), $next_page = prev($pages);
'base_url' => $settings['base_url'], $this->run_hooks('get_pages', array(&$pages, &$current_page, &$prev_page, &$next_page));
'theme_dir' => THEMES_DIR . $settings['theme'],
'theme_url' => $settings['base_url'] .'/'. basename(THEMES_DIR) .'/'. $settings['theme'], // Load the theme
'site_title' => $settings['site_title'], $this->run_hooks('before_twig_register');
'meta' => $meta, Twig_Autoloader::register();
'content' => $content, $loader = new Twig_Loader_Filesystem(THEMES_DIR . $settings['theme']);
'pages' => $pages, $twig = new Twig_Environment($loader, $settings['twig_config']);
'prev_page' => $prev_page, $twig->addExtension(new Twig_Extension_Debug());
'current_page' => $current_page, $twig_vars = array(
'next_page' => $next_page, 'config' => $settings,
'is_front_page' => $url ? false : true, 'base_dir' => rtrim(ROOT_DIR, '/'),
); 'base_url' => $settings['base_url'],
'theme_dir' => THEMES_DIR . $settings['theme'],
$template = (isset($meta['template']) && $meta['template']) ? $meta['template'] : 'index'; 'theme_url' => $settings['base_url'] . '/' . basename(THEMES_DIR) . '/' . $settings['theme'],
$this->run_hooks('before_render', array(&$twig_vars, &$twig, &$template)); 'site_title' => $settings['site_title'],
$output = $twig->render($template .'.html', $twig_vars); 'meta' => $meta,
$this->run_hooks('after_render', array(&$output)); 'content' => $content,
echo $output; 'pages' => $pages,
} 'prev_page' => $prev_page,
'current_page' => $current_page,
/** 'next_page' => $next_page,
* Load any plugins 'is_front_page' => $url ? false : true,
*/ );
protected function load_plugins()
{ $template = (isset($meta['template']) && $meta['template']) ? $meta['template'] : 'index';
$this->plugins = array(); $this->run_hooks('before_render', array(&$twig_vars, &$twig, &$template));
$plugins = $this->get_files(PLUGINS_DIR, '.php'); $output = $twig->render($template . '.html', $twig_vars);
if(!empty($plugins)){ $this->run_hooks('after_render', array(&$output));
foreach($plugins as $plugin){ echo $output;
include_once($plugin); }
$plugin_name = preg_replace("/\\.[^.\\s]{3}$/", '', basename($plugin));
if(class_exists($plugin_name)){ /**
$obj = new $plugin_name; * Load any plugins
$this->plugins[] = $obj; */
} protected function load_plugins()
} {
} $this->plugins = array();
} $plugins = $this->get_files(PLUGINS_DIR, '.php');
if (!empty($plugins)) {
/** foreach ($plugins as $plugin) {
* Parses the content using Parsedown-extra include_once($plugin);
* $plugin_name = preg_replace("/\\.[^.\\s]{3}$/", '', basename($plugin));
* @param string $content the raw txt content if (class_exists($plugin_name)) {
* @return string $content the Markdown formatted content $obj = new $plugin_name;
*/ $this->plugins[] = $obj;
protected function parse_content($content) }
{ }
$content = preg_replace('#/\*.+?\*/#s', '', $content, 1); // Remove first comment (with meta) }
$content = str_replace('%base_url%', $this->base_url(), $content); }
$content = (new ParsedownExtra())->text($content);
/**
return $content; * Parses the content using Parsedown-extra
} *
* @param string $content the raw txt content
/** * @return string $content the Markdown formatted content
* Parses the file meta from the txt file header */
* protected function parse_content($content)
* @param string $content the raw txt content {
* @return array $headers an array of meta values $content = preg_replace('#/\*.+?\*/#s', '', $content, 1); // Remove first comment (with meta)
*/ $content = str_replace('%base_url%', $this->base_url(), $content);
protected function read_file_meta($content) $content = (new ParsedownExtra())->text($content);
{
$config = $this->config; return $content;
}
$headers = array(
'title' => 'Title', /**
'description' => 'Description', * Parses the file meta from the txt file header
'author' => 'Author', *
'date' => 'Date', * @param string $content the raw txt content
'robots' => 'Robots', * @return array $headers an array of meta values
'template' => 'Template' */
); protected function read_file_meta($content)
{
// Add support for custom headers by hooking into the headers array $config = $this->config;
$this->run_hooks('before_read_file_meta', array(&$headers));
$headers = array(
foreach ($headers as $field => $regex){ 'title' => 'Title',
if (preg_match('/^[ \t\/*#@]*' . preg_quote($regex, '/') . ':(.*)$/mi', $content, $match) && $match[1]){ 'description' => 'Description',
$headers[ $field ] = trim(preg_replace("/\s*(?:\*\/|\?>).*/", '', $match[1])); 'author' => 'Author',
} else { 'date' => 'Date',
$headers[ $field ] = ''; 'robots' => 'Robots',
} 'template' => 'Template'
} );
if(isset($headers['date'])) $headers['date_formatted'] = utf8_encode(strftime($config['date_format'], strtotime($headers['date']))); // Add support for custom headers by hooking into the headers array
$this->run_hooks('before_read_file_meta', array(&$headers));
return $headers;
} foreach ($headers as $field => $regex) {
if (preg_match('/^[ \t\/*#@]*' . preg_quote($regex, '/') . ':(.*)$/mi', $content, $match) && $match[1]) {
/** $headers[$field] = trim(preg_replace("/\s*(?:\*\/|\?>).*/", '', $match[1]));
* Loads the config } else {
* $headers[$field] = '';
* @return array $config an array of config values }
*/ }
protected function get_config()
{ if (isset($headers['date'])) {
$headers['date_formatted'] = utf8_encode(strftime($config['date_format'], strtotime($headers['date'])));
$this->config = @include_once(ROOT_DIR .'config.php'); }
$defaults = array( return $headers;
'site_title' => 'Pico', }
'base_url' => $this->base_url(),
'theme' => 'default', /**
'date_format' => '%D %T', * Loads the config
'twig_config' => array('cache' => false, 'autoescape' => false, 'debug' => false), *
'pages_order_by' => 'alpha', * @return array $config an array of config values
'pages_order' => 'asc', */
'excerpt_length' => 50, protected function get_config()
{
$this->config = @include_once(ROOT_DIR . 'config.php');
$defaults = array(
'site_title' => 'Pico',
'base_url' => $this->base_url(),
'theme' => 'default',
'date_format' => '%D %T',
'twig_config' => array('cache' => false, 'autoescape' => false, 'debug' => false),
'pages_order_by' => 'alpha',
'pages_order' => 'asc',
'excerpt_length' => 50,
'content_dir' => 'content-sample/', 'content_dir' => 'content-sample/',
); );
if(is_array($this->config)) $this->config = array_merge($defaults, $this->config); if (is_array($this->config)) {
else $this->config = $defaults; $this->config = array_merge($defaults, $this->config);
} else {
return $this->config; $this->config = $defaults;
} }
/** return $this->config;
* Get a list of pages }
*
* @param string $base_url the base URL of the site /**
* @param string $order_by order by "alpha" or "date" * Get a list of pages
* @param string $order order "asc" or "desc" *
* @return array $sorted_pages an array of pages * @param string $base_url the base URL of the site
*/ * @param string $order_by order by "alpha" or "date"
protected function get_pages($base_url, $order_by = 'alpha', $order = 'asc', $excerpt_length = 50) * @param string $order order "asc" or "desc"
{ * @return array $sorted_pages an array of pages
$config = $this->config; */
protected function get_pages($base_url, $order_by = 'alpha', $order = 'asc', $excerpt_length = 50)
$pages = $this->get_files($config['content_dir'], CONTENT_EXT); {
$sorted_pages = array(); $config = $this->config;
$date_id = 0;
foreach($pages as $key=>$page){ $pages = $this->get_files($config['content_dir'], CONTENT_EXT);
// Skip 404 $sorted_pages = array();
if(basename($page) == '404'. CONTENT_EXT){ $date_id = 0;
unset($pages[$key]); foreach ($pages as $key => $page) {
continue; // Skip 404
} if (basename($page) == '404' . CONTENT_EXT) {
unset($pages[$key]);
// Ignore Emacs (and Nano) temp files continue;
if (in_array(substr($page, -1), array('~','#'))) { }
unset($pages[$key]);
continue; // Ignore Emacs (and Nano) temp files
} if (in_array(substr($page, -1), array('~', '#'))) {
// Get title and format $page unset($pages[$key]);
$page_content = file_get_contents($page); continue;
$page_meta = $this->read_file_meta($page_content); }
$page_content = $this->parse_content($page_content); // Get title and format $page
$url = str_replace($config['content_dir'], $base_url .'/', $page); $page_content = file_get_contents($page);
$url = str_replace('index'. CONTENT_EXT, '', $url); $page_meta = $this->read_file_meta($page_content);
$url = str_replace(CONTENT_EXT, '', $url); $page_content = $this->parse_content($page_content);
$data = array( $url = str_replace($config['content_dir'], $base_url . '/', $page);
'title' => isset($page_meta['title']) ? $page_meta['title'] : '', $url = str_replace('index' . CONTENT_EXT, '', $url);
'url' => $url, $url = str_replace(CONTENT_EXT, '', $url);
'author' => isset($page_meta['author']) ? $page_meta['author'] : '', $data = array(
'date' => isset($page_meta['date']) ? $page_meta['date'] : '', 'title' => isset($page_meta['title']) ? $page_meta['title'] : '',
'date_formatted' => isset($page_meta['date']) ? utf8_encode(strftime($config['date_format'], strtotime($page_meta['date']))) : '', 'url' => $url,
'content' => $page_content, 'author' => isset($page_meta['author']) ? $page_meta['author'] : '',
'excerpt' => $this->limit_words(strip_tags($page_content), $excerpt_length), 'date' => isset($page_meta['date']) ? $page_meta['date'] : '',
//this addition allows the 'description' meta to be picked up in content areas... specifically to replace 'excerpt' 'date_formatted' => isset($page_meta['date']) ? utf8_encode(strftime($config['date_format'],
'description' => isset($page_meta['description']) ? $page_meta['description'] : '', strtotime($page_meta['date']))) : '',
'content' => $page_content,
); 'excerpt' => $this->limit_words(strip_tags($page_content), $excerpt_length),
//this addition allows the 'description' meta to be picked up in content areas... specifically to replace 'excerpt'
// Extend the data provided with each page by hooking into the data array 'description' => isset($page_meta['description']) ? $page_meta['description'] : '',
$this->run_hooks('get_page_data', array(&$data, $page_meta));
);
if($order_by == 'date' && isset($page_meta['date'])){
$sorted_pages[$page_meta['date'].$date_id] = $data; // Extend the data provided with each page by hooking into the data array
$date_id++; $this->run_hooks('get_page_data', array(&$data, $page_meta));
}
else $sorted_pages[$page] = $data; if ($order_by == 'date' && isset($page_meta['date'])) {
} $sorted_pages[$page_meta['date'] . $date_id] = $data;
$date_id++;
if($order == 'desc') krsort($sorted_pages); } else {
else ksort($sorted_pages); $sorted_pages[$page] = $data;
}
return $sorted_pages; }
}
if ($order == 'desc') {
/** krsort($sorted_pages);
* Processes any hooks and runs them } else {
* ksort($sorted_pages);
* @param string $hook_id the ID of the hook }
* @param array $args optional arguments
*/ return $sorted_pages;
protected function run_hooks($hook_id, $args = array()) }
{
if(!empty($this->plugins)){ /**
foreach($this->plugins as $plugin){ * Processes any hooks and runs them
if(is_callable(array($plugin, $hook_id))){ *
call_user_func_array(array($plugin, $hook_id), $args); * @param string $hook_id the ID of the hook
} * @param array $args optional arguments
} */
} protected function run_hooks($hook_id, $args = array())
} {
if (!empty($this->plugins)) {
/** foreach ($this->plugins as $plugin) {
* Helper function to work out the base URL if (is_callable(array($plugin, $hook_id))) {
* call_user_func_array(array($plugin, $hook_id), $args);
* @return string the base url }
*/ }
protected function base_url() }
{ }
$config = $this->config;
/**
if(isset($config['base_url']) && $config['base_url']) return $config['base_url']; * Helper function to work out the base URL
*
$url = ''; * @return string the base url
$request_url = (isset($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : ''; */
$script_url = (isset($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : ''; protected function base_url()
if($request_url != $script_url) $url = trim(preg_replace('/'. str_replace('/', '\/', str_replace('index.php', '', $script_url)) .'/', '', $request_url, 1), '/'); {
$config = $this->config;
$protocol = $this->get_protocol();
return rtrim(str_replace($url, '', $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']), '/'); if (isset($config['base_url']) && $config['base_url']) {
} return $config['base_url'];
}
/**
* Tries to guess the server protocol. Used in base_url() $url = '';
* $request_url = (isset($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : '';
* @return string the current protocol $script_url = (isset($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : '';
*/ if ($request_url != $script_url) {
protected function get_protocol() $url = trim(preg_replace('/' . str_replace('/', '\/', str_replace('index.php', '', $script_url)) . '/', '',
{ $request_url, 1), '/');
$protocol = 'http'; }
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' && $_SERVER['HTTPS'] != ''){
$protocol = 'https'; $protocol = $this->get_protocol();
}
return $protocol; return rtrim(str_replace($url, '', $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']), '/');
} }
/** /**
* Helper function to recusively get all files in a directory * Tries to guess the server protocol. Used in base_url()
* *
* @param string $directory start directory * @return string the current protocol
* @param string $ext optional limit to file extensions */
* @return array the matched files protected function get_protocol()
*/ {
protected function get_files($directory, $ext = '') $protocol = 'http';
{ if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' && $_SERVER['HTTPS'] != '') {
$array_items = array(); $protocol = 'https';
if($handle = opendir($directory)){ }
while(false !== ($file = readdir($handle))){
if(in_array(substr($file, -1), array('~', '#'))){ return $protocol;
continue; }
}
if(preg_match("/^(^\.)/", $file) === 0){ /**
if(is_dir($directory. "/" . $file)){ * Helper function to recusively get all files in a directory
$array_items = array_merge($array_items, $this->get_files($directory. "/" . $file, $ext)); *
} else { * @param string $directory start directory
$file = $directory . "/" . $file; * @param string $ext optional limit to file extensions
if(!$ext || strstr($file, $ext)) $array_items[] = preg_replace("/\/\//si", "/", $file); * @return array the matched files
} */
} protected function get_files($directory, $ext = '')
} {
closedir($handle); $array_items = array();
} if ($handle = opendir($directory)) {
return $array_items; while (false !== ($file = readdir($handle))) {
} if (in_array(substr($file, -1), array('~', '#'))) {
continue;
/** }
* Helper function to limit the words in a string if (preg_match("/^(^\.)/", $file) === 0) {
* if (is_dir($directory . "/" . $file)) {
* @param string $string the given string $array_items = array_merge($array_items, $this->get_files($directory . "/" . $file, $ext));
* @param int $word_limit the number of words to limit to } else {
* @return string the limited string $file = $directory . "/" . $file;
*/ if (!$ext || strstr($file, $ext)) {
protected function limit_words($string, $word_limit) $array_items[] = preg_replace("/\/\//si", "/", $file);
{ }
$words = explode(' ',$string); }
$excerpt = trim(implode(' ', array_splice($words, 0, $word_limit))); }
if(count($words) > $word_limit) $excerpt .= '&hellip;'; }
return $excerpt; closedir($handle);
} }
return $array_items;
}
/**
* Helper function to limit the words in a string
*
* @param string $string the given string
* @param int $word_limit the number of words to limit to
* @return string the limited string
*/
protected function limit_words($string, $word_limit)
{
$words = explode(' ', $string);
$excerpt = trim(implode(' ', array_splice($words, 0, $word_limit)));
if (count($words) > $word_limit) {
$excerpt .= '&hellip;';
}
return $excerpt;
}
} }

@ -7,88 +7,89 @@
* @link http://picocms.org * @link http://picocms.org
* @license http://opensource.org/licenses/MIT * @license http://opensource.org/licenses/MIT
*/ */
class Pico_Plugin { class Pico_Plugin
{
public function plugins_loaded()
{ public function plugins_loaded()
{
}
}
public function config_loaded(&$settings)
{ public function config_loaded(&$settings)
{
}
}
public function request_url(&$url)
{ public function request_url(&$url)
{
}
}
public function before_load_content(&$file)
{ public function before_load_content(&$file)
{
}
}
public function after_load_content(&$file, &$content)
{ public function after_load_content(&$file, &$content)
{
}
}
public function before_404_load_content(&$file)
{ public function before_404_load_content(&$file)
{
}
}
public function after_404_load_content(&$file, &$content)
{ public function after_404_load_content(&$file, &$content)
{
}
}
public function before_read_file_meta(&$headers)
{ public function before_read_file_meta(&$headers)
{
}
}
public function file_meta(&$meta)
{ public function file_meta(&$meta)
{
}
}
public function before_parse_content(&$content)
{ public function before_parse_content(&$content)
{
}
}
public function after_parse_content(&$content)
{ public function after_parse_content(&$content)
{
}
}
public function get_page_data(&$data, $page_meta)
{ public function get_page_data(&$data, $page_meta)
{
}
}
public function get_pages(&$pages, &$current_page, &$prev_page, &$next_page)
{ public function get_pages(&$pages, &$current_page, &$prev_page, &$next_page)
{
}
}
public function before_twig_register()
{ public function before_twig_register()
{
}
}
public function before_render(&$twig_vars, &$twig, &$template)
{ public function before_render(&$twig_vars, &$twig, &$template)
{
}
}
public function after_render(&$output)
{ public function after_render(&$output)
{
}
}
} }
?> ?>

Loading…
Cancel
Save