API

Overview of the bitframe-leagueplates package including classes and their methods and properties

View Source

namespace BitFrame\Renderer;

use \Closure;
use \League\Plates\Engine;
use \League\Plates\Template\Name;
use \League\Plates\Extension\URI;
use \BitFrame\Renderer\TemplatePath;

// implements:
use \BitFrame\Renderer\TemplateInterface;

// exceptions:
use \InvalidArgumentException;
use \BitFrame\Exception\FileNotReadableException;

/**
 * League Plates template renderer add-on.
 */
class PlatesRenderer implements TemplateInterface 
{
    /** @var Engine */
    private $template;
    
    /**
     * @param string|null $templateDir
     * @param string $templateExt (optional, default: 'tpl')
     * @param array $data (optional, default: [])
     *
     * @see Engine::__construct()
     */
    public function __construct(  );
    
    /**
     * Render template.
     *
     * @param string $templateName
     * @param array $data (optional, default: [])
     *
     * @return string
     *
     * @throws FileNotReadableException
     *
     * @see: TemplateInterface::render()
     */
    public function render(  ): string;
    
    /**
     * Proxies to the Plate Engine's `addData()` method. 
     *
     * @param string $templateName 
     * @param array $params
     *
     * @throws InvalidArgumentException
     *
     * @see: TemplateInterface::addDefaultParam()
     */
    public function addDefaultParam(  );
    
    /**
     * Add a template path to the engine. 
     *
     * @param string $path
     * @param string|null $namespace (optional, default: null)
     *
     * @return void
     *
     * @see: TemplateInterface::addPath()
     */
    public function addPath(  ): void;
    
    /**
     * Retrieve configured paths from the engine.
     *
     * @return TemplatePath[]
     *
     * @see: TemplateInterface::getPaths()
     */
    public function getPaths(): array;
    
    /**
     * Get Template Engine class.
     *
     * @return Engine
     */
    public function getEngine(): Engine;
    
    /**
     * Create and return a TemplatePath representing 
	 * the default Plates directory.
     *
     * @return TemplatePath
     */
    private function getDefaultPath(): TemplatePath;

    /**
     * Return the internal array of plates folders.
     *
     * @return \League\Plates\Template\Folder[]
     */
    private function getPlatesFolders(): array;
}

Comments

Let us know if you have something to say or add