当前位置: 首页>>代码示例>>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;未经允许,请勿转载。