diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2008-11-27 00:26:04 +0000 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2008-11-27 00:26:04 +0000 |
| commit | d881c91e0c542133187e00d62c9191add7a5c33d (patch) | |
| tree | 23cccf4a825ab410e6b2ca48ed3b107d3952d86e /modules/tag/controllers | |
| parent | e3fa1c8acd0e617651e9b4a613413dc51521c63d (diff) | |
Trying to add tags, but it doesn't work yet. For some reason that i can't figure out, the form never validates and I never get into the true branch of the if. I'm taking a break for awhile.
Diffstat (limited to 'modules/tag/controllers')
| -rw-r--r-- | modules/tag/controllers/tags.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php index db5f93bd..a09c789d 100644 --- a/modules/tag/controllers/tags.php +++ b/modules/tag/controllers/tags.php @@ -47,11 +47,23 @@ class Tags_Controller extends REST_Controller { } public function _form_add($parameters) { - throw new Exception("@todo Tag_Controller::_form NOT IMPLEMENTED"); + $item_id = is_array($parameters) ? $parameters[0] : $parameters; + $form = tag::get_add_form($item_id); + if ($form->validate()) { + Kohana::log("debug", print_r($this->inputs->post(), true)); + Kohana::log("debug", $form->inputs["text"]->value); + $tags = explode(",", $form->inputs["text"]->value); + Kohana::log("debug", print_r($tags, true)); + + $item = ORM::factory("item", $item_id); +// $form->inputs["text"] = "add new tags..."; + } + Kohana::log("debug", print_r($form, true)); + print $form->render(); } public function _form_edit($tag) { - throw new Exception("@todo Tag_Controller::_form NOT IMPLEMENTED"); + throw new Exception("@todo Tag_Controller::_form_edit NOT IMPLEMENTED"); } public function _create($tag) { |
