本文整理汇总了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++;
}
}