本文整理匯總了PHP中Widget::validate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Widget::validate方法的具體用法?PHP Widget::validate怎麽用?PHP Widget::validate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Widget
的用法示例。
在下文中一共展示了Widget::validate方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: validate
/**
* Clear result if nothing has been submitted
*/
public function validate()
{
parent::validate();
if (!isset($_POST[$this->strName])) {
$this->varValue = '';
}
}
示例2: validate
/**
* Check for a valid option (see #4383)
*/
public function validate()
{
$varValue = $this->getPost($this->strName);
if (!empty($varValue) && !$this->isValidOption($varValue)) {
$this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['invalid'], is_array($varValue) ? implode(', ', $varValue) : $varValue));
}
parent::validate();
}
示例3: validate
/**
* Check for a valid option (see #4383)
*/
public function validate()
{
$varValue = deserialize($this->getPost($this->strName));
if ($varValue != '' && !$this->isValidOption($varValue)) {
$this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['invalid'], $varValue));
}
parent::validate();
}
示例4: validate
/**
* Check for a valid option (see #4383)
*/
public function validate()
{
$varValue = deserialize($this->getPost($this->strName));
// validation deactivated for editing reasons
// if ($varValue != '' && !$this->isValidOption($varValue))
// {
// $this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['invalid'], $varValue));
// }
parent::validate();
}
示例5: validate
/**
* Clear result if nothing has been submitted
*/
public function validate()
{
parent::validate();
// Workaround for key sorting in DataContainer ~line 285
$i = 0;
foreach ($this->varValue as $k => $v) {
if (!$v['enabled']) {
unset($this->varValue[$k]);
continue;
}
$this->varValue[$k]['position'] = $i++;
}
}