function runValidator($fields, $errors) { //Set the counter $i = 0; //Loop them and build the validation profile foreach ($fields as $f) { //Validate $this->form_validation->set_rules($f, error_name($f), $errors[$i]); //Increment the counter $i++; } //Set the delimiter, this is for kieran really $this->form_validation->set_error_delimiters('<small class="help-block form-error">', '</small>'); }
?> <p>Customer Type <span class="lead"> Individual </span> </p> <p><?php echo error_name($key); ?> <span class="lead"> <?php echo !empty($customer_data[0]->{$key}) ? $customer_data[0]->{$key} : $na; ?> </span> </p> <?php }
/** * PHP错误的处理的接管函数 */ public function errorHandle($err, $msg, $file, $line, $context) { $err = error_name($err); $time = date('Y-m-d H:i:s'); $this->halt("[{$err}][{$time}] {$msg} ({$file}#{$line})"); }
<section class="content-header white-bg-border"> <h1><?php echo isset($welcome_message) ? $welcome_message : error_name($this->prefix); ?> </h1> <ol class="breadcrumb"> <li><a href="/clientarea/">Dashboard</a></li> <li><a href="/clientarea/<?php echo $this->prefix; ?> "><?php echo error_name($this->prefix); ?> </a></li> <?php if (!empty($this->file_ext)) { ?> <li><?php echo error_name($this->file_ext); ?> </li> <?php } ?> </ol> </section>
<?php if ($arr == true) { $fields = array('company_name', 'company_number', 'vat_number'); foreach ($fields as $f) { $array = ${'' . $f . ''}['name'] . '[]'; ${'' . $f . ''}['name'] = $array; } $array = '[]'; } echo '<div class="form-group"><label for="exampleInputEmail1">' . error_name($company_name['name']) . '</label>'; echo form_input($company_name) . "\n"; echo form_error('company_name'); echo "</div>"; echo '<div class="form-group"><label for="exampleInputEmail1">Company Type</label>'; echo form_dropdown('company_type' . ($arr == true ? '[]' : NULL), $c_opts, !empty($row_data) ? $row_data->company_type : NULL, "class='" . $class . (form_error('company_type') ? " error " : NULL) . "' data-name='company_type'") . "\n"; echo form_error('company_type'); echo "</div>"; ?> <div class="hide"> <div class="form-group"><label for="exampleInputEmail1">Company Number</label> <?php echo form_input($company_number) . "\n"; ?> </div> <div class="form-group"><label for="exampleInputEmail1">Vat Number</label> <?php