Skip to content

Commit

Permalink
Added IRenderable interface
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalyiegorov committed Dec 12, 2014
1 parent 577f1e3 commit 67ee050
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/IRenderable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Created by PhpStorm.
* User: egorov
* Date: 12.12.2014
* Time: 9:50
*/

namespace samson\core;

/**
* Generic view rendering interface defining
* all main view context operations.
* @package samson\core
*/
interface IViewable
{
/**
* Set view variable
* @param string $key Variable key\prefix for objects and arrays
* @param mixed $value Variable value
* @return IViewable Chaining
*/
public function set($key, $value);

/**
* Set current view for rendering.
* Method searches for the shortest matching view path by $pathPattern,
* from loaded views.
*
* @param string $pathPattern Path pattern for view searching
* @return IViewable Chaining
*/
public function view($pathPattern);

/**
* Render current view.
* Method uses current view context and outputs rendering
* result.
*
* @return string Rendered view
*/
public function output();
}

0 comments on commit 67ee050

Please sign in to comment.