Skip to content
This repository has been archived by the owner on Aug 13, 2020. It is now read-only.

Commit

Permalink
Updated folders and plugin support
Browse files Browse the repository at this point in the history
  • Loading branch information
josephspurrier committed May 3, 2014
1 parent 0e022d3 commit 30811f3
Show file tree
Hide file tree
Showing 22 changed files with 338 additions and 183 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,19 @@
* @license http://www.apache.org/licenses/LICENSE-2.0.html
*/

namespace SurfStack\Templating\Plugin;
namespace SurfStack\Templating\Core;

/**
* SurfStack Template Engine Slice
* SurfStack Template Engine Block
*
* Renders content in a template.
* Designated by an open {name} and close {/name} tag.
* Designated by a single {name} tag.
*/
abstract class Slice
{
/**
* Array of settings from Template Engine
* @var array
*/
public $internal = array();

abstract class Block extends PluginBase
{
/**
* Called by the template, expects a return value
* @param array $arrData
* @param string $strContent Content written between the tags
*/
abstract function render($arrData);
abstract function render($strContent);
}
48 changes: 48 additions & 0 deletions src/SurfStack/Templating/Core/PluginBase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

/**
* This file is part of the SurfStack package.
*
* @package SurfStack
* @copyright Copyright (C) Joseph Spurrier. All rights reserved.
* @author Joseph Spurrier (http://josephspurrier.com)
* @license http://www.apache.org/licenses/LICENSE-2.0.html
*/

namespace SurfStack\Templating\Core;

/**
* SurfStack Template Plugin Base
*
* Renders content in a template.
*/
abstract class PluginBase
{
/**
* Array of settings from Template Engine
* @var array
*/
protected $arrEngineInternals = array();

/**
* Array of assigned variables from Template Engine
* @var array
*/
protected $arrEngineVariables = array();

/**
* Array of passed variables to the plugin
* @var array
*/
protected $arrPluginVariables = array();

/**
* Store a data to a variable
* @param string $key
* @param string $value
*/
public function store($key, $value)
{
$this->$key = $value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,18 @@
* @license http://www.apache.org/licenses/LICENSE-2.0.html
*/

namespace SurfStack\Templating\Plugin;
namespace SurfStack\Templating\Core;

/**
* SurfStack Template Engine Slice
*
* Renders content in a template.
* Designated by an open {name} and close {/name} tag.
*/
abstract class Slice
{
/**
* Array of settings from Template Engine
* @var array
*/
public $internal = array();

abstract class Slice extends PluginBase
{
/**
* Called by the template, expects a return value
* @param array $arrData
*/
abstract function render($arrData);
abstract function render();
}
34 changes: 0 additions & 34 deletions src/SurfStack/Templating/Plugin/Block.php

This file was deleted.

11 changes: 0 additions & 11 deletions src/SurfStack/Templating/Plugin/Bold.php

This file was deleted.

11 changes: 0 additions & 11 deletions src/SurfStack/Templating/Plugin/Time.php

This file was deleted.

Loading

0 comments on commit 30811f3

Please sign in to comment.