本文整理汇总了PHP中Zend_View_Interface::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View_Interface::render方法的具体用法?PHP Zend_View_Interface::render怎么用?PHP Zend_View_Interface::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_View_Interface
的用法示例。
在下文中一共展示了Zend_View_Interface::render方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkSkinStyles
/**
*
*/
public function checkSkinStyles($name, $values)
{
$config = Zend_Registry::get('config');
$basePath = $config->design->pathToSkins;
$xhtml = array();
$this->view->name = $name;
$this->view->selectedStyles = $values;
//load the skin folders
if (is_dir('./' . $basePath)) {
$folders = Digitalus_Filesystem_Dir::getDirectories('./' . $basePath);
if (count($folders) > 0) {
foreach ($folders as $folder) {
$this->view->skin = $folder;
$styles = Digitalus_Filesystem_File::getFilesByType('./' . $basePath . '/' . $folder . '/styles', 'css');
if (is_array($styles)) {
foreach ($styles as $style) {
//add each style sheet to the hash
// key = path / value = filename
$hashStyles[$style] = $style;
}
$this->view->styles = $hashStyles;
$xhtml[] = $this->view->render($this->partialFile);
unset($hashStyles);
}
}
}
} else {
throw new Zend_Acl_Exception('Unable to locate skin folder');
}
return implode(null, $xhtml);
}
示例2: indexAction
public function indexAction()
{
// STAGE 3: Choose, create, and optionally update models using business logic.
$cities = parse_ini_file('cities.ini');
// $cities contains our simple data model
// STAGE 4: Apply business logic to create a presentation model for the view.
ksort($_SERVER);
$this->_view->SERVER = $_SERVER;
$this->_view->date = date('Y-m-d H:i:s');
$this->_view->cities = array();
$this->_view->distances = array();
if (isset($_REQUEST['distance'])) {
$maxDistance = intval($_REQUEST['distance']);
} else {
$this->_redirect('/?distance=10000');
}
$this->_view->maxDistance = $maxDistance;
foreach ($cities as $city => $distance) {
// business logic specifies to filter the data model satisfying distance criteria
if ($distance < $maxDistance) {
$this->_view->cities[] = $city;
$this->_view->distances[] = $distance;
#echo "Distance from London, UK to $city is $distance km.<br>\n";
}
}
// STAGE 5: Choose view and submit presentation model to view.
$this->_response->appendBody($this->_view->render('indexIndex.phtml'));
}
示例3: menu
/**
* @return string
*/
public function menu()
{
$model = new Site_Model_Menu();
$items = $model->fetchAll(null, 'orderid');
$activeItem = $model->fetchRow(array('"' . addcslashes($this->view->url(), "'") . '" LIKE CONCAT("%",url,"%")'), 'LENGTH(url) desc');
$this->view->items = $items;
if ($activeItem) {
$this->view->activeId = $activeItem->id;
}
return $this->view->render('menu.phtml');
}
示例4: renderTemplate
private function renderTemplate($templateName)
{
if (!strpos($templateName, '.phtml')) {
$templateName .= '.phtml';
}
return $this->view->render($templateName);
}
示例5: renderScript
/**
* Render a view script (optionally to a named response segment)
*
* Sets the noRender flag to true when called.
*
* @param string $script
* @param string $name
* @return void
*/
public function renderScript($script, $name = null)
{
if (null === $name) {
$name = $this->getResponseSegment();
}
$this->getResponse()->appendBody($this->view->render($script), $name);
$this->setNoRender();
}
示例6: renderScript
/**
* Render a view script (optionally to a named response segment)
*
* Sets the noRender flag to true when called.
*
* @param string $script
* @param string $name
* @return void
*/
public function renderScript($script, $name = null)
{
if (null === $name) {
$name = $this->getResponseSegment();
}
require_once 'Zend/Log.php';
require_once 'Zend/Log/Writer/Stream.php';
$log = new Zend_Log(new Zend_Log_Writer_Stream('/tmp/zf.log'));
$log->info(sprintf('Preparing to render script "%s"', $script));
$this->getResponse()->appendBody(
$this->view->render($script),
$name
);
$this->setNoRender();
}
示例7: renderBody
private function renderBody($script)
{
return $this->_view->render($script);
}
示例8: render
/**
* Renders the module content with the module template.
*
* @return string
*/
public function render($template, $vars = array(), $spec = null)
{
$template = $template . $this->_templateSuffix;
if (null === $spec) {
$this->view->assign($vars);
} else {
$this->view->assign($spec, $vars);
}
return $this->view->render($template);
}