本文整理汇总了PHP中Load::Helper方法的典型用法代码示例。如果您正苦于以下问题:PHP Load::Helper方法的具体用法?PHP Load::Helper怎么用?PHP Load::Helper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Load
的用法示例。
在下文中一共展示了Load::Helper方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Render
public function Render($form = "", $response_location = "", $url = "", $args = "")
{
$errorMsg = '';
$errors = FALSE;
$Load = new Load();
if (function_exists('is_empty') == FALSE) {
// Load validate helper
$Load->Helper('validate');
}
if (is_empty($form) == FALSE) {
$this->form = $form;
}
if (is_empty($response_location) == FALSE) {
$this->response_location = $response_location;
}
if (is_empty($url) == FALSE) {
$this->url = $url;
}
if (is_empty($args) == FALSE) {
$this->args = $args;
}
if (is_empty($this->form)) {
$errorMsg .= ' form requerido :$obj-> Form("id-form")<br /> ';
$errors = TRUE;
}
if (is_empty($this->response_location)) {
$errorMsg .= ' response_location requerido : $obj-> ResponseLocation("id-div-location")<br /> ';
$errors = TRUE;
}
if (is_empty($this->url)) {
$errorMsg .= ' url requerida : $obj-> Url("Controller/Action")<br /> ';
$errors = TRUE;
}
if ($errors == TRUE) {
echo 'Error:<br />' . $errorMsg;
return FALSE;
} else {
// Crear respuesta
$butonsCode = $this->RenderButtons();
$params = 'form:' . $this->form . ';url:' . $this->url . ';args:' . $this->args . ';';
$fx = new fk_ajax('submit', $this->response_location, $params);
$Result = ' <script type="text/javascript">
<!--
' . $butonsCode . '
$("#' . $this->form . '").validate({
submitHandler: function(form) {
' . $fx->render() . '
return false;
},invalidHandler: function(form, validator){
var errors = validator.numberOfInvalids();
if (errors) { alert("Por favor, llena los campos obligatorios");}
}
});
//-->
</script>';
return $Result;
}
}