CodeIgniter Forums
Buliding CodeIgniter App - Need advice on XFORMS - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Buliding CodeIgniter App - Need advice on XFORMS (/showthread.php?tid=18992)



Buliding CodeIgniter App - Need advice on XFORMS - El Forum - 05-24-2009

[eluser]Unknown[/eluser]
Hello

I am building an application, and one of the requirements is to use XFORMS not HTML Forms. Can anybody advice on how to implement XFORMS in CodeIgniter.

Thanks guys!


Buliding CodeIgniter App - Need advice on XFORMS - El Forum - 05-25-2009

[eluser]Unknown[/eluser]
First, you should use a client-side XForms implementation. You might use the Mozilla extension or an AJAX based solution such as XSLTForms (http://www.agencexml.com/xsltforms).

HTML Table Class is not compatible with the MVC approach in XForms, the Form Validation Class neither...


Buliding CodeIgniter App - Need advice on XFORMS - El Forum - 05-25-2009

[eluser]xwero[/eluser]
If you want the browser to parse xforms i guess it will be nothing more than putting the xform markup in the view files. I'm not sure if the markup can be parsed if it's embedded in text/html outputted content.

The second obstacle is i don't think all browsers support native xform, some don't even support the current css specifications. So you need a severside parser removing a great feature of xforms, the event handlers, as the serverside parser will output an html form.
For CI it means if you have a serverside parser you have to load that library and bind the output to the master view if there is one or use a serverside parser that catches the forms in the views directory and it has a method that can output the cache file.
Code:
// output to master view example
$data['content'] = $this->xforms_parser->to_html('some_form.xml')->get_rendered_content();
// cached output example
$this->load->view($this->xforms_parser->to_html('some_form.xml')->get_cache_name());