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


PHP Settings::getCategories方法代码示例

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


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

示例1: missingAction

 public function missingAction($actionID)
 {
     $categories = Settings::getCategories();
     if (in_array($actionID, $categories)) {
         $this->showSettings($actionID);
     } else {
         throw new CHttpException(404, 'No such category exists for settings!');
     }
 }
开发者ID:awecode,项目名称:awecms,代码行数:9,代码来源:SettingsController.php

示例2: getDashboardMenu

 public static function getDashboardMenu()
 {
     $dashboard = new Dashboard();
     $menuItems = $dashboard->getMenuItems();
     //for settings
     foreach (Settings::getCategories() as $settingsCategory) {
         $menuItems['Settings'][] = array(Awecms::generateFriendlyName($settingsCategory) . ' Settings', array('/admin/settings/' . $settingsCategory));
     }
     //reading the menu items into an array that zii.widgets.jui.CJuiAccordion can take as panels
     $menuConfig = array();
     foreach ($menuItems as $menuName => $menuItem) {
         $menuConfig[$menuName] = '';
         foreach ($menuItem as $menuLink) {
             $menuConfig[$menuName] .= CHtml::link(AdminModule::t($menuLink[0]), $menuLink[1]) . "<br/>";
         }
     }
     return $menuConfig;
 }
开发者ID:awecode,项目名称:awecms,代码行数:18,代码来源:AdminModule.php

示例3: getCategoriesAsLinks

 public static function getCategoriesAsLinks($action = '')
 {
     //url isn't created for $action
     $settings = array();
     foreach (Settings::getCategories() as $settingsCategory) {
         $item = array();
         $item['label'] = Yii::t('app', Awecms::generateFriendlyName($settingsCategory)) . ' ' . Yii::t('app', 'Settings');
         if ($action != $settingsCategory) {
             $item['url'] = '/settings/' . $settingsCategory;
             if ($action) {
                 $item['url'] = Yii::app()->baseUrl . '/admin' . $item['url'];
             }
         }
         $settings[] = $item;
     }
     return $settings;
 }
开发者ID:awecode,项目名称:awecms,代码行数:17,代码来源:Settings.php

示例4: array

<?php

$this->breadcrumbs = array(Yii::t('app', 'Settings'), Yii::t('app', 'Add new settings field'));
$this->menu = Settings::getCategoriesAsLinks($action);
echo '<h1>' . Yii::t('app', 'Add new settings field') . ':</h1>';
echo CHtml::beginForm('', 'post', array('onsubmit' => 'return validateForm(this)', 'class' => 'form'));
?>

<div class="settings row">
    <?php 
echo CHtml::label('Category', 'category');
echo CHtml::dropDownList('category', $action, Awecms::generatePairs(array_merge(Settings::getCategories(), array('add_new'))), array('onchange' => 'dropDownChanged(this)'));
echo CHtml::textField('category_value', '', array('size' => '30', 'style' => 'display:none'));
?>
</div>

<div class="settings row">
    <?php 
echo CHtml::label('Key', 'key');
echo CHtml::textField('key', '', array('size' => '50'));
?>
</div>

<div class="settings row">
    <?php 
echo CHtml::label('Value', 'value');
echo CHtml::textField('value', '', array('size' => '50'));
?>
</div>

<div class="settings row">
开发者ID:awecode,项目名称:awecms,代码行数:31,代码来源:add.php


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