本文整理匯總了PHP中kartik\base\Config::isValidInput方法的典型用法代碼示例。如果您正苦於以下問題:PHP Config::isValidInput方法的具體用法?PHP Config::isValidInput怎麽用?PHP Config::isValidInput使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類kartik\base\Config
的用法示例。
在下文中一共展示了Config::isValidInput方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
/**
* Initializes the widget
*
* @throws InvalidConfigException
*/
public function init()
{
$this->_msgCat = 'kveditable';
parent::init();
if (empty($this->inputType)) {
throw new InvalidConfigException("The 'type' of editable input must be set.");
}
if (!Config::isValidInput($this->inputType)) {
throw new InvalidConfigException("Invalid input type '{$this->inputType}'.");
}
if ($this->inputType === self::INPUT_WIDGET && empty($this->widgetClass)) {
throw new InvalidConfigException("The 'widgetClass' must be set when the 'inputType' is set to 'widget'.");
}
if (Config::isDropdownInput($this->inputType) && !isset($this->data)) {
throw new InvalidConfigException("You must set the 'data' property for '{$this->inputType}'.");
}
if (!empty($this->formClass) && !class_exists($this->formClass)) {
throw new InvalidConfigException("The form class '{$this->formClass}' does not exist.");
}
Config::validateInputWidget($this->inputType);
$this->initI18N(__DIR__);
$this->initOptions();
$this->_popoverOptions['options']['id'] = $this->options['id'] . '-popover';
$this->_popoverOptions['toggleButton']['id'] = $this->options['id'] . '-targ';
$this->registerAssets();
echo Html::beginTag('div', $this->containerOptions);
if ($this->format == self::FORMAT_BUTTON) {
echo Html::tag('div', $this->displayValue, $this->editableValueOptions);
}
if ($this->asPopover === true) {
PopoverX::begin($this->_popoverOptions);
} elseif ($this->format !== self::FORMAT_BUTTON) {
echo $this->renderToggleButton();
}
echo Html::beginTag('div', $this->contentOptions);
$class = $this->formClass;
$this->_form = $class::begin($this->formOptions);
if (!$this->_form instanceof \yii\widgets\ActiveForm) {
throw new InvalidConfigException("The form class '{$class}' MUST extend from \\yii\\widgets\\ActiveForm.");
}
}