当前位置: 首页>>代码示例>>PHP>>正文


PHP View::getRender方法代码示例

本文整理汇总了PHP中Phalcon\Mvc\View::getRender方法的典型用法代码示例。如果您正苦于以下问题:PHP View::getRender方法的具体用法?PHP View::getRender怎么用?PHP View::getRender使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Phalcon\Mvc\View的用法示例。


在下文中一共展示了View::getRender方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render

 /**
  * {@inheritdoc}
  */
 public function render($params = array())
 {
     $currentViewsDir = $this->view->getViewsDir();
     $this->view->setViewsDir($this->getServiceViewPath());
     $this->view->disableLevel(View::LEVEL_LAYOUT);
     $content = $this->view->getRender('services', $this->templateName, $params);
     //rollback viewsDir
     $this->view->setViewsDir($currentViewsDir);
     return $content;
 }
开发者ID:arius86,项目名称:core,代码行数:13,代码来源:Renderer.php

示例2: render

 /**
  * @param string $layout
  *
  * @return string
  */
 public function render($layout = 'edit')
 {
     $column = $this->_params->getParam('name');
     $prefix = $this->_params->getParam('source');
     $fieldId = ($prefix ? $prefix . '_' : '') . $column;
     $fieldName = $prefix ? $prefix . '[' . $column . ']' : $column;
     $defaultParams = $this->_params->getParams();
     unset($defaultParams['name']);
     $tagParams = array_merge([$fieldName], $this->_params->getParam('tag', []), ['value' => $this->getValue(), 'id' => $fieldId] + $defaultParams);
     $this->_params->setParam('id', $fieldId);
     // все параметры уже добавлены, в общем списке они не нужны
     unset($tagParams['tag']);
     $tagParams['class'] = isset($tagParams['class']) ? $tagParams['class'] . ' form-control' : 'form-control';
     $layout = $this->_params->getParam('options.layout', $layout);
     $this->beforeRender($tagParams);
     $this->_view->setLayout($layout);
     $this->_view->setVars(['field' => $this, 'model' => $this->_model, 'params' => $this->_params, 'tag' => $tagParams]);
     return $this->_view->getRender($this->getLayoutDir($layout), $layout);
 }
开发者ID:moaljazaery,项目名称:phalcon-module-admin,代码行数:24,代码来源:Field.php

示例3: renderContent

 /**
  * render the content of an existing view : $controller/$action and set the response to the modal content
  * @param View $view
  * @param string $controller a Phalcon controller
  * @param string $action a Phalcon action
  * @param $params The parameters to pass to the view
  */
 public function renderContent($view, $controller, $action, $params = NULL)
 {
     $template = $view->getRender($controller, $action, $params, function ($view) {
         $view->setRenderLevel(View::LEVEL_ACTION_VIEW);
     });
     $this->content = $template;
 }
开发者ID:aleboisselier,项目名称:phalcon-jquery,代码行数:14,代码来源:HtmlModal.php

示例4: renderToolbar

 public function renderToolbar()
 {
     $view = new View();
     $viewDir = dirname(__FILE__) . '/views/';
     $view->setViewsDir($viewDir);
     // set vars
     $view->debugWidget = $this;
     $content = $view->getRender('toolbar', 'index');
     return $content;
 }
开发者ID:juicechu,项目名称:phalcon-debug-widget,代码行数:10,代码来源:DebugWidget.php

示例5: testGetRender

 public function testGetRender()
 {
     $view = new Phalcon\Mvc\View();
     $view->setViewsDir('unit-tests/views/');
     $content = $view->getRender('test5', 'index', array('cool_var' => 'le-this'));
     $this->assertEquals($content, '<html>Hey, this is a partial, also le-this</html>' . PHP_EOL);
 }
开发者ID:racklin,项目名称:cphalcon,代码行数:7,代码来源:ViewTest.php

示例6: testViewParamIsset

 /**
  * @covers \Phalcon\Mvc\View::__isset
  */
 public function testViewParamIsset()
 {
     $view = new View();
     $view->setViewsDir('unit-tests/views/');
     $view->set_param = 'something';
     $content = $view->getRender('test16', 'index');
     $this->assertEquals($content, '<html>1</html>' . PHP_EOL);
 }
开发者ID:mattvb91,项目名称:cphalcon,代码行数:11,代码来源:ViewTest.php

示例7: renderToolbar

 /**
  * @return string
  */
 public function renderToolbar()
 {
     $view = new View();
     $viewDir = __DIR__ . '/views/';
     $view->setViewsDir($viewDir);
     $view->setVar('debugWidget', $this);
     $content = $view->getRender('toolbar', 'index');
     return $content;
 }
开发者ID:TheCodemasterZz,项目名称:phalcon-debug-widget,代码行数:12,代码来源:DebugWidget.php

示例8: testViewParamIsset

 /**
  * @covers \Phalcon\Mvc\View::__isset
  */
 public function testViewParamIsset()
 {
     $this->specify("Setting View parameters doesn't work", function () {
         $view = new View();
         $view->setViewsDir(PATH_DATA . "views" . DIRECTORY_SEPARATOR);
         $view->set_param = "something";
         $content = $view->getRender("test16", "index");
         expect($content)->equals("<html>1</html>" . PHP_EOL);
     });
 }
开发者ID:phalcon,项目名称:cphalcon,代码行数:13,代码来源:ViewTest.php


注:本文中的Phalcon\Mvc\View::getRender方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。