本文整理匯總了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>';
}