本文整理匯總了PHP中Phalcon\Mvc\View::partial方法的典型用法代碼示例。如果您正苦於以下問題:PHP View::partial方法的具體用法?PHP View::partial怎麽用?PHP View::partial使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Phalcon\Mvc\View
的用法示例。
在下文中一共展示了View::partial方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: resourceNotFound
private function resourceNotFound($resourceKey, View $view)
{
$view->setViewsDir(__DIR__ . '/../modules/Index/views/');
$view->setPartialsDir('');
$view->message = "Acl resource <b>{$resourceKey}</b> in <b>/app/config/acl.php</b> not exists";
$view->partial('error/error404');
$response = new \Phalcon\Http\Response();
$response->setHeader(404, 'Not Found');
$response->sendHeaders();
echo $response->getContent();
exit;
}
示例2: setBreadrumbsView
/**
* Setup Breadcrumbs views dir
* @param string $value
* @access public
* @return this
*/
public function setBreadrumbsView(View $view, $value)
{
$this->_viewDir = (string) $value;
$view->setPartialsDir($this->_viewDir);
$view->partial($this->_partialName, ['elements' => $this->_elements, 'separator' => $this->_separator]);
return;
}
示例3: render
/**
* Render the given view
*
* @param string $view
* @param array $data
*
* @return string
*/
protected function render($view, $data)
{
ob_start();
$this->view->partial($view, $data);
$content = ob_get_clean();
return $content;
}
示例4: _viewRender
/**
* Render template.
*
* @param string $template Template name.
* @param array $params Template params.
*
* @return string
*/
private function _viewRender($template, $params)
{
ob_start();
$viewsDir = $this->_view->getViewsDir();
$this->_view->setViewsDir(ROOT_PATH . '/app/modules/Core/View/');
$this->_view->partial('partials/profiler/' . $template, $params);
$this->_view->setViewsDir($viewsDir);
$html = ob_get_contents();
ob_end_clean();
return $html;
}
示例5: testIssue2140
public function testIssue2140()
{
$view = new View();
$view->setBasePath(__DIR__ . '/../');
$view->setViewsDir('unit-tests/views/');
$html = $view->partial('test2/index', NULL, FALSE);
$this->assertEquals($html, 'here');
}