本文整理汇总了PHP中AForm::setErrors方法的典型用法代码示例。如果您正苦于以下问题:PHP AForm::setErrors方法的具体用法?PHP AForm::setErrors怎么用?PHP AForm::setErrors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AForm
的用法示例。
在下文中一共展示了AForm::setErrors方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBlockContent
protected function getBlockContent($instance_id)
{
$block_info = $this->layout->getBlockDetails($instance_id);
$custom_block_id = $block_info['custom_block_id'];
$descriptions = $this->layout->getBlockDescriptions($custom_block_id);
if ($descriptions[$this->config->get('storefront_language_id')]) {
$key = $this->config->get('storefront_language_id');
} else {
$key = $descriptions ? key($descriptions) : null;
}
if ($descriptions[$key]['content']) {
$content = unserialize($descriptions[$key]['content']);
} else {
$content = array('form_id' => null);
}
$this->loadModel('tool/forms_manager');
$form_data = $this->model_tool_forms_manager->getForm($content['form_id']);
if (empty($form_data)) {
return array();
}
$field_types = $this->model_tool_forms_manager->getFieldTypes($content['form_id']);
$form = new AForm();
$form->loadFromDb($form_data['form_name']);
$form_info = $form->getForm();
$form_info['controller'] = $form_info['controller'] . '&form_id=' . $content['form_id'];
$form->setForm($form_info);
if (isset($this->session->data['custom_form_' . $content['form_id']]['errors'])) {
$form->setErrors($this->session->data['custom_form_' . $content['form_id']]['errors']);
unset($this->session->data['custom_form_' . $content['form_id']]['errors']);
}
$output = array('title' => $key ? $descriptions[$key]['title'] : '', 'content' => $form->getFormHtml(), 'block_wrapper' => $key ? $descriptions[$key]['block_wrapper'] : 0, 'block_framed' => $key ? (int) $descriptions[$key]['block_framed'] : 0);
return $output;
}
示例2: _validate
/**
* @return bool
*/
private function _validate()
{
$this->error = array_merge($this->form->validateFormData($this->request->post), $this->error);
if (!$this->error) {
return TRUE;
} else {
$this->form->setErrors($this->error);
return FALSE;
}
}
示例3: _validate
/**
* @return bool
*/
private function _validate()
{
$this->error = array_merge($this->form->validateFormData($this->request->post), $this->error);
$this->extensions->hk_ValidateData($this);
if (!$this->error) {
return true;
} else {
$this->form->setErrors($this->error);
return false;
}
}