* $view = new Phalcon\Mvc\View\Simple();
* echo $view->render('templates/my-view', array('content' => $html));
*
*
*/
class Simple extends \Phalcon\DI\Injectable implements \Phalcon\Events\EventsAwareInterface, \Phalcon\DI\InjectionAwareInterface {
protected $_options;
protected $_viewsDir;
protected $_partialsDir;
protected $_viewParams;
protected $_engines;
protected $_registeredEngines;
protected $_activeRenderPath;
protected $_content;
protected $_cache;
protected $_cacheOptions;
/**
* \Phalcon\Mvc\View constructor
*
* @param array $options
*/
public function __construct($options=null){ }
/**
* Sets views directory. Depending of your platform, always add a trailing slash or backslash
*
* @param string $viewsDir
*/
public function setViewsDir($viewsDir){ }
/**
* Gets views directory
*
* @return string
*/
public function getViewsDir(){ }
/**
* Register templating engines
*
*
*$this->view->registerEngines(array(
* ".phtml" => "Phalcon\Mvc\View\Engine\Php",
* ".volt" => "Phalcon\Mvc\View\Engine\Volt",
* ".mhtml" => "MyCustomEngine"
*));
*
*
* @param array $engines
*/
public function registerEngines($engines){ }
/**
* Loads registered template engines, if none is registered it will use \Phalcon\Mvc\View\Engine\Php
*
* @return array
*/
protected function _loadTemplateEngines(){ }
/**
* Tries to render the view with every engine registered in the component
*
* @param string $path
* @param array $params
*/
protected function _internalRender(){ }
/**
* Renders a view
*
* @param string $path
* @param array $params
* @return string
*/
public function render($path, $params=null){ }
/**
* Renders a partial view
*
*
* //Show a partial inside another view
* $this->partial('shared/footer');
*
*
*
* //Show a partial inside another view with parameters
* $this->partial('shared/footer', array('content' => $html));
*
*
* @param string $partialPath
* @param array $params
*/
public function partial($partialPath, $params=null){ }
/**
* Sets the cache options
*
* @param array $options
* @return \Phalcon\Mvc\View\Simple
*/
public function setCacheOptions($options){ }
/**
* Returns the cache options
*
* @return array
*/
public function getCacheOptions(){ }
/**
* Create a \Phalcon\Cache based on the internal cache options
*
* @return \Phalcon\Cache\BackendInterface
*/
protected function _createCache(){ }
/**
* Returns the cache instance used to cache
*
* @return \Phalcon\Cache\BackendInterface
*/
public function getCache(){ }
/**
* Cache the actual view render to certain level
*
*
* $this->view->cache(array('key' => 'my-key', 'lifetime' => 86400));
*
*
* @param boolean|array $options
* @return \Phalcon\Mvc\View\Simple
*/
public function cache($options=null){ }
/**
* Adds parameters to views (alias of setVar)
*
*
* $this->view->setParamToView('products', $products);
*
*
* @param string $key
* @param mixed $value
* @return \Phalcon\Mvc\View\Simple
*/
public function setParamToView($key, $value){ }
/**
* Set all the render params
*
*
* $this->view->setVars(array('products' => $products));
*
*
* @param array $params
* @param boolean $merge
* @return \Phalcon\Mvc\View\Simple
*/
public function setVars($params, $merge=null){ }
/**
* Set a single view parameter
*
*
* $this->view->setVar('products', $products);
*
*
* @param string $key
* @param mixed $value
* @return \Phalcon\Mvc\View\Simple
*/
public function setVar($key, $value){ }
/**
* Returns a parameter previously set in the view
*
* @param string $key
* @return mixed
*/
public function getVar($key){ }
/**
* Returns parameters to views
*
* @return array
*/
public function getParamsToView(){ }
/**
* Externally sets the view content
*
*
* $this->view->setContent("hello
");
*
*
* @param string $content
* @return \Phalcon\Mvc\View\Simple
*/
public function setContent($content){ }
/**
* Returns cached ouput from another view stage
*
* @return string
*/
public function getContent(){ }
/**
* Returns the path of the view that is currently rendered
*
* @return string
*/
public function getActiveRenderPath(){ }
/**
* Magic method to pass variables to the views
*
*
* $this->view->products = $products;
*
*
* @param string $key
* @param mixed $value
*/
public function __set($key, $value){ }
/**
* Magic method to retrieve a variable passed to the view
*
*
* echo $this->view->products;
*
*
* @param string $key
* @return mixed
*/
public function __get($key){ }
}
}