CodeIgniter Forums
Dwoo and validation/repopulation of forms - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Dwoo and validation/repopulation of forms (/showthread.php?tid=32880)



Dwoo and validation/repopulation of forms - El Forum - 08-08-2010

[eluser]Unknown[/eluser]
I am trying to use Dwoo as a template engine to allow my client's to dynamically adjust templates without running into security issues by allowing them to use PHP.

But I got a major issue with validation.

I actually do not know how to allow repopulation of these forms.

Any advice? How can I enable and call the set_checkbox, etc. functions to work in a Dwoo template?

I am using Phil's library to integrate Dwoo: http://philsturgeon.co.uk/news/2009/11/Give-CodeIgniters-Parser-library-more-kick-with-Dwoo

Thank you very much!


Dwoo and validation/repopulation of forms - El Forum - 08-08-2010

[eluser]Vheissu[/eluser]
I'm using Dwoo inside of my projects and find that I can call Codeigniter functions like so:

Code:
{set_value('field_name')}

If that doesn't work for you, then try passing through a super variable of the Codeigniter instance itself inside of your controller.

Code:
$data['CI'] = &get;_instance();
$this->parser->parse('template_name', $data);

Then inside of your template file you can do this:

Code:
{$CI->set_value('field_name')}

Also make sure that you are loading the form validation library first, that could be one of your issues if none of those solutions work for you.


Dwoo and validation/repopulation of forms - El Forum - 08-09-2010

[eluser]Unknown[/eluser]
-- ignore my posting I almost figured it out

As soon as I got the solution I will post it here.