Move the CSRF initialization into the constructor, I don't see why we

need it also in render().
This commit is contained in:
Bharat Mediratta
2009-11-25 20:05:38 -08:00
parent 9d9e4bdb67
commit 4b2e1344b4
+1 -2
View File
@@ -24,14 +24,13 @@ class Forge extends Forge_Core {
*/
public function __construct($action=null, $title='', $method=null, $attr=array()) {
parent::__construct($action, $title, $method, $attr);
$this->hidden("csrf")->value("");
$this->hidden("csrf")->value(access::csrf_token());
}
/**
* Use our own template
*/
public function render($template="form.html", $custom=false) {
$this->hidden["csrf"]->value(access::csrf_token());
return parent::render($template, $custom);
}