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


PHP Controller::renderPartial方法代码示例

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


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

示例1: actionGet_product_view

 public function actionGet_product_view()
 {
     if (Yii::$app->request->isAjax) {
         $id = $_POST['id'];
         $response['update_view'] = \yii\base\Controller::renderPartial('view', ['model' => $this->findModel($id)]);
         return json_encode($response);
     }
 }
开发者ID:hsleonis,项目名称:achitecture,代码行数:8,代码来源:ProductController.php

示例2: show

 public function show($type = 'T')
 {
     $model = new Controller();
     $userMenu = ArrayHelper::map(self::find()->where(['type' => $type])->all(), 'title', 'url');
     $pageMenu = ArrayHelper::map(Pages::find()->where(['menu' => $type])->all(), 'title', 'url');
     foreach ($pageMenu as $title => $url) {
         $pageMenu[$title] = Url::toRoute(['/page/view', 'url' => $url]);
     }
     $items = array_merge($userMenu, $pageMenu);
     return $model->renderPartial('/report/menu', ['items' => $items]);
 }
开发者ID:CherryPieCo,项目名称:SB,代码行数:11,代码来源:Menu.php

示例3: setView

 /**
  * Displays an e-mail in preview mode.
  * @param string $view the view name. Please refer to [[render()]] on how to specify a view name. example: '//mail/register', the view file in backend backend/views folder.
  * @param array $vars the parameters (name-value pairs) that should be made available in the view. example: ['name' => 'harry', 'link' => 'http://wm.com/XXXX'].
  * @param string $layout example: '//layouts/email', the view file in backend backend/layouts folder.
  */
 public function setView($view, $vars = array(), $layout = null)
 {
     // Get default controller
     $controller = Yii::$app->controller;
     if (empty($controller)) {
         $controller = new Controller('site', Yii::$app->module);
     }
     $body = $controller->renderPartial($view, $vars);
     if ($layout === null) {
         $this->_view = $body;
     } else {
         // Render the layout file with content
         $this->_view = $controller->renderPartial($layout, array('content' => $body));
     }
 }
开发者ID:timelessmemory,项目名称:uhkklp,代码行数:21,代码来源:Mailer.php

示例4: actionProduct_view

 public function actionProduct_view()
 {
     if (Yii::$app->request->isAjax) {
         $this->layout = 'blank';
         $id = $_POST['id'];
         $model = ProductCategory::find()->where(['id' => $id])->one();
         $data = ProductCategoryRel::find()->where(['category_id' => $id])->orderBy('sort_order', 'DESC')->all();
         $response['upload_view'] = \yii\base\Controller::renderPartial('product_list_product_view', ['model' => $model, 'data' => $data]);
         $response['Category_name'] = $model->cat_title;
         return json_encode($response);
     }
 }
开发者ID:hsleonis,项目名称:basetech,代码行数:12,代码来源:CategoryController.php


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