CodeIgniter Forums
XSLT views - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: XSLT views (/thread-12976.html)



XSLT views - El Forum - 11-06-2008

[eluser]moesian[/eluser]
Hi,

Is anyone here using xslt to create their views?

Is client-side xslt creation of pages a viable option or is the xslt best peformed serverside? (I'm only really interested in a site working for current browsers and ie6)

The idea of being able to transform an xml document to create pages for specific devices using different xsl files sounds appealing, but are there issues I should be aware of? (Speed, extra processing)

Thanks


XSLT views - El Forum - 08-12-2010

[eluser]al042077[/eluser]
I'm no expert, but I'd say to do the processing on the server side rather than depending on the client. Perhaps you could merge with an XSL template according to the user agent - one for PC browser, one for mobile phone, and maybe one for just text.

I thought about this early on, too, but it felt redundant of the views. You'd be creating a separate XSL template for each user agent anyways, why not just create separate view file and be done. Perhaps develop a naming scheme such as:
Quote:browser_my_home.php
mobile_my_home.php
text_my_home.php
Then call the view with a variable (setup earlier as shown in the example at http://ellislab.com/codeigniter/user-guide/libraries/user_agent.html):
Code:
$this->load->view($agent.'_my_home');
I'm not certain, but I'd guess this is faster as it wouldn't require processing of the XML/XSL.