當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Languages::lists方法代碼示例

本文整理匯總了PHP中Languages::lists方法的典型用法代碼示例。如果您正苦於以下問題:PHP Languages::lists方法的具體用法?PHP Languages::lists怎麽用?PHP Languages::lists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Languages的用法示例。


在下文中一共展示了Languages::lists方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _setLanguages

 /**
  * Sets a list of languages to the view which can be used in selects
  *
  * @deprecated No fallback provided, use the Utils plugin in your app directly
  * @param string $viewVar View variable name, default is languages
  * @throws MissingPluginException
  * @return void
  * @link https://github.com/CakeDC/utils
  */
 protected function _setLanguages($viewVar = 'languages')
 {
     $this->_pluginLoaded('Utils');
     $Languages = new Languages();
     $this->set($viewVar, $Languages->lists('locale'));
 }
開發者ID:shivram2609,項目名稱:bbm,代碼行數:15,代碼來源:UsersController.php

示例2: _setLanguages

 /**
  * Sets a list of languages to the view which can be used in selects
  *
  * @deprecated No fallback provided, use the Utils plugin in your app directly
  * @param string View variable name, default is languages
  * @return void
  * @link https://github.com/CakeDC/utils
  */
 protected function _setLanguages($viewVar = 'languages')
 {
     if (!App::import('Lib', 'Utils.Languages')) {
         throw new MissingPluginException(array('plugin' => 'Utils'));
     }
     $Languages = new Languages();
     $this->set($viewVar, $Languages->lists('locale'));
 }
開發者ID:robksawyer,項目名稱:grabitdown,代碼行數:16,代碼來源:UsersController.php

示例3: _setLanguages

 /**
  * Sets a list of languages to the view which can be used in selects
  *
  * @param string View variable name, default is languages
  * @return void
  */
 protected function _setLanguages($viewVar = 'languages')
 {
     App::import('Lib', 'Utils.Languages');
     $Languages = new Languages();
     $this->set($viewVar, $Languages->lists('locale'));
 }
開發者ID:neterslandreau,項目名稱:bones,代碼行數:12,代碼來源:users_controller.php

示例4: admin_edit

 /**
  * Admin edit for category.
  *
  * @param string $id, category id 
  */
 public function admin_edit($id = null)
 {
     try {
         $actualLanguages = $this->Category->getSupportedLanguages();
         App::uses('Languages', 'Utils.Lib');
         $Languages = new Languages();
         $languages = $Languages->lists('locale');
         $this->set(compact('languages', 'actualLanguages'));
         $result = $this->Category->edit($id, null, $this->request->data);
         if ($result === true) {
             $this->Session->setFlash(__d('categories', 'Category saved'));
             $this->redirect(array('action' => 'view', $this->Category->data[$this->Category->alias]['slug']));
         } else {
             $this->request->data = $result;
         }
     } catch (OutOfBoundsException $e) {
         $this->Session->setFlash($e->getMessage());
         $this->redirect('/');
     }
     $categories = $this->Category->find('list');
     $users = $this->Category->User->find('list');
     $this->set(compact('categories', 'users'));
 }
開發者ID:jxav,項目名稱:categories,代碼行數:28,代碼來源:I18nCategoriesController.php


注:本文中的Languages::lists方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。