Skip to content

Instantly share code, notes, and snippets.

@AmyStephen
Created April 18, 2013 21:13
Show Gist options
  • Save AmyStephen/5416271 to your computer and use it in GitHub Desktop.
Save AmyStephen/5416271 to your computer and use it in GitHub Desktop.
Theme Interface
<?php
/**
* Template Interface
*
* @package Molajo
* @copyright 2013 Amy Stephen. All rights reserved.
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
namespace Molajo\Theme\Api;
defined('MOLAJO') or die;
use Molajo\Theme\Exception\ThemeException;
/**
* Theme Interface
*
* @package Molajo
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @copyright 2013 Amy Stephen. All rights reserved.
* @since 1.0
*/
interface ThemeInterface
{
/**
* Return the value of the specified key
*
* @param string $key
* @param mixed $default
*
* @return mixed
* @since 1.0
* @throws ThemeException
*/
public function get($key, $default = null);
/**
* Set the value of the specified key
*
* @param string $key
* @param array $options
*
* @return $this
* @since 1.0
* @throws ThemeException
*/
public function set($key, $options = array());
/**
* Define the variables that identified Variables
*
* @param array $tags
*
* @return $this
* @since 1.0
* @throws ThemeException
*/
public function defineTags($tags = array());
/**
* Parse rendered output for tags
*
* @param string $rendered_output
*
* @return array
* @since 1.0
* @throws ThemeException
*/
public function parseTags($rendered_output);
/**
* Get input data associated with the tag processed
*
* This could be a database query, retrieval of a link, translation of a literal value, or the
* replacement of a smiley tag with an image tag
*
* @param string $tag
* @param array $options
*
* @return object
* @since 1.0
* @throws ThemeException
*/
public function getData($tag, $options = array());
/**
* Push the input into the Template and capture rendered output
*
* Includes escaping rendered output and formatting requirements
*
* @param object $data
* @param string $template
* @param array $options
*
* @return mixed
* @since 1.0
* @throws ThemeException
*/
public function renderOutput($data, $template, $options = array());
/**
* Locate the tag that was used as a basic for retrieving input data and the template
* and replace it with the rendered output for that tag
*
* @param string $tag
* @param string $rendered_output
*
* @return $this
* @since 1.0
* @throws ThemeException
*/
public function replaceTags($tag, $rendered_output);
/**
* Remove Comments found within the rendered output
*
* @return $this
* @since 1.0
* @throws ThemeException
*/
public function removeComments();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment