本文整理汇总了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!');
}
}
示例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;
}
示例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;
}
示例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">