本文整理匯總了PHP中FormAction::setTitle方法的典型用法代碼示例。如果您正苦於以下問題:PHP FormAction::setTitle方法的具體用法?PHP FormAction::setTitle怎麽用?PHP FormAction::setTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FormAction
的用法示例。
在下文中一共展示了FormAction::setTitle方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: definePrevNextActions
/**
* Call this instead of manually creating your actions
*
* You can easily rename actions by calling $actions->fieldByName('action_doNext')->setTitle('...')
*
* @param bool $doSet
* @return FieldList
*/
protected function definePrevNextActions($doSet = false)
{
$actions = new FieldList();
$prevClass = 'FormAction';
// do not validate if used in conjonction with zenvalidator
if (class_exists('FormActionNoValidation')) {
$prevClass = 'FormActionNoValidation';
}
$prev = null;
if (self::classNameNumber() > 1) {
$actions->push($prev = new $prevClass('doPrev', _t('FormExtra.doPrev', 'Previous')));
$prev->addExtraClass('step-prev');
$prev->setUseButtonTag(true);
}
$label = _t('FormExtra.doNext', 'Next');
$actions->push($next = new FormAction('doNext', $label));
$next->setUseButtonTag(true);
$next->addExtraClass('step-next');
if (!$prev) {
$next->addExtraClass('step-next-single');
}
if (self::isLastStep()) {
$next->setTitle(_t('FormExtra.doFinish', 'Finish'));
$next->addExtraClass('step-last');
}
$this->addExtraClass('form-steps');
if (!$doSet) {
$this->setActions($actions);
$actions->setForm($this);
}
return $actions;
}