本文整理汇总了PHP中ArrayUtil::setAndTrue方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayUtil::setAndTrue方法的具体用法?PHP ArrayUtil::setAndTrue怎么用?PHP ArrayUtil::setAndTrue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayUtil
的用法示例。
在下文中一共展示了ArrayUtil::setAndTrue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderButtons
public function renderButtons()
{
if (0 === ($count = count($this->buttons))) {
return;
}
if ($count > 1) {
echo '<div class="x2-button-group x2-grid-view-controls-buttons">';
} else {
echo '<div class="x2-grid-view-controls-buttons">';
}
$lastChildClass = '';
for ($i = 0; $i < $count; ++$i) {
$button = $this->buttons[$i];
if ($i === $count - 1) {
$lastChildClass = ' x2-last-child';
}
switch ($button) {
case 'advancedSearch':
break;
// remove until fixed
echo CHtml::link('', '#', array('title' => Yii::t('app', 'Advanced Search'), 'class' => 'x2-button search-button' . $lastChildClass));
break;
case 'clearFilters':
$url = array_merge(array(Yii::app()->controller->action->id), Yii::app()->controller->getActionParams(), array('clearFilters' => 1));
echo CHtml::link('', $url, array('title' => Yii::t('app', 'Clear Filters'), 'class' => 'fa fa-filter fa-lg x2-button filter-button' . $lastChildClass));
break;
case 'columnSelector':
echo CHtml::link('', 'javascript:void(0);', array('title' => Yii::t('app', 'Columns'), 'class' => 'fa fa-columns fa-lg column-selector-link x2-button' . $lastChildClass));
break;
case 'autoResize':
echo CHtml::link('', 'javascript:void(0);', array('title' => Yii::t('app', 'Auto-resize columns'), 'class' => 'fa fa-arrows-h fa-lg auto-resize-button x2-button' . $lastChildClass));
break;
case 'refresh':
echo CHtml::link('', 'javascript:void(0);', array('title' => Yii::t('app', 'Refresh grid'), 'class' => 'fa fa-refresh fa-lg refresh-button x2-button' . $lastChildClass));
break;
case 'showHidden':
if (Yii::app()->user->checkAccess($this->_moduleName . 'Admin')) {
echo CHtml::link('', '#', array('title' => Yii::t('app', 'Show Hidden'), 'class' => (ArrayUtil::setAndTrue($_GET, 'showHidden') ? 'clicked ' : '') . 'fa fa-eye-slash fa-lg x2-button show-hidden-button' . $lastChildClass));
}
break;
default:
echo $button;
}
}
echo '</div>';
}