CodeIgniter Forums
phaml library, loader, or hook - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: phaml library, loader, or hook (/thread-29184.html)



phaml library, loader, or hook - El Forum - 04-01-2010

[eluser]luke holder[/eluser]
hello guys and girls.

I'm crazy and i am attempting to implement the phaml class into codeigniter.

http://phaml.sourceforge.net/

I have successfully been able to make it an acceptable codeignitor library class and the constructor is working.

Code:
$this->load->library('phaml');

$template=
'!!!!
%html
  %head
    %title Hello From pHAML!!
  %body
    %p Hello World';            
echo $this->phaml->render($template);

This works fine and great.

Obviously I would like to somehow hook this lib into CI, especially somehow into the native view loader etc.

Where would be the best place to do so? It needs to be before the view is loaded and passed its $data.

I tried extending the view class but that didnt seem right, unless i just use phaml to generate the view file and save it before loading the view. how could i do this on the fly and not need to generate the file and then load the view?

any suggestions would be great.

thanks.


phaml library, loader, or hook - El Forum - 10-10-2010

[eluser]umefarooq[/eluser]
better to extend you CI parser class create new MY_Parser and call your phaml class and render views in that class and append in output class i have also luck with phphaml class but with haml facing one problem which i face can not wrap multiple tags in one parent tag like i want to wrap text and anchor with haml

Code:
%p= $text anchor('http://www.google.com','Google');

if you have any update please shere