當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。