Welcome Guest, Not a member yet? Register   Sign In
phaml library, loader, or hook
#1

[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.
#2

[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




Theme © iAndrew 2016 - Forum software by © MyBB