本文整理汇总了PHP中AdminAction::validate方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminAction::validate方法的具体用法?PHP AdminAction::validate怎么用?PHP AdminAction::validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminAction
的用法示例。
在下文中一共展示了AdminAction::validate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validate
/**
* Check that the parameter is correct.
*/
function validate()
{
// let's make sure that the "page" parameter has a sane value
// and that it is not below 0
$val = new IntegerValidator();
$this->_page = $this->_request->getValue("page");
if (!$val->validate($this->_page) || $this->_page < 0) {
$this->_page = 1;
}
// run the real validation stuff...
return parent::validate();
}
示例2: validate
function validate()
{
if (!parent::validate()) {
$resources = new GalleryResources();
$resource = $resources->getResource($this->_request->getValue("resourceId"), $this->_blogInfo->getId());
if (!$resource) {
$this->setValidationErrorView(new AdminResourcesListView($this->_blogInfo));
$this->setCommonData();
return false;
}
$this->_view->setValue("resource", $resource);
return false;
}
return true;
}
示例3: validate
/**
* Validates that the information we've just received from the blog settings
* form is valid... We have to be really sure about this one!!!
*/
function validate()
{
// if all correct, we can proceed
$this->_userPassword = trim($this->_request->getValue("userSettingsPassword"));
$this->_userConfirmPassword = trim($this->_request->getValue("confirmPassword"));
$valid = parent::validate();
// check that the password is correct and confirm it
if ($this->_userPassword != "") {
$passwordVal = new PasswordValidator();
if (!$passwordVal->validate($this->_userPassword)) {
$this->_form->setFieldValidationStatus("userSettingsPassword", false);
$this->setCommonData(true);
return false;
}
if ($this->_userPassword != $this->_userConfirmPassword) {
$this->_form->setFieldValidationStatus("confirmPassword", false);
$this->setCommonData(true);
return false;
}
}
return $valid;
}