Example #1
0
 /**
  * Exection hook
  *
  * @param Stencil_Interface $controller Controller that initiated this class.
  */
 public function execute(Stencil_Interface $controller)
 {
     $post_type = get_post_type();
     Stencil_Environment::trigger('single', $controller);
     Stencil_Environment::trigger($post_type, $controller);
     Stencil_Environment::trigger(get_the_ID(), $controller);
     $page_template = get_page_template();
     if ($page_template) {
         // Always include template file.
         include $page_template;
         $page_template_base = basename($page_template);
         Stencil_File_System::load($page_template_base);
         Stencil_Environment::trigger(rtrim($page_template_base, '.php'), $controller);
         Stencil_Environment::trigger($page_template_base, $controller);
     }
 }
/**
 * Get the right controller and include it
 *
 * This is generally used inside a router.php Stencil hook
 *
 * @param string $file Control file to include.
 *
 * @return bool
 */
function include_stencil_controller($file)
{
    return Stencil_File_System::load($file);
}