mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-20 03:19:13 -04:00
associates them with the form. This replaces the various _add_validation_rules() functions in the user and comment modules. Move user edit form into user helper for consistency with the comment module. Implement missing _form method in the user controller.
20 lines
517 B
PHP
20 lines
517 B
PHP
<?php
|
|
class Forge extends Forge_Core {
|
|
public function render($template="form.html", $custom=false) {
|
|
return parent::render($template, $custom);
|
|
}
|
|
|
|
/**
|
|
* Associate validation rules defined in the model with this form.
|
|
*/
|
|
public function add_rules_from($model) {
|
|
foreach ($this->inputs as $name => $input) {
|
|
if (isset($input->inputs)) {
|
|
$input->add_rules_from($model);
|
|
}
|
|
if (isset($model->rules[$name])) {
|
|
$input->rules($model->rules[$name]);
|
|
}
|
|
}
|
|
}
|
|
} |