GroceryCRUD + Template Engine
- Single Page
Posted 11 March 2012 - 21:45 PM
I'm developing a project using CodeIgniter and a Template Engine (Twig, and parser library). But, when i display my $output i have an error:
I've use the parser library too but i have got the same error:
the code:
...
$output = $this->grocery_crud->render();
$this->parser->parse('view.php' $output);
....
the error:
[b] A PHP Error was encountered[/b]
[color=#555555]Severity: 4096[/color]
[color=#555555][b]Message: Object of class stdClass could not be converted to string[/b][/color]
[color=#555555]Filename: 2d/d3a53a7a1b5fb7e12be4121ed245.php[/color]
[color=#555555]Line Number: 91[/color]
Posted 11 March 2012 - 23:53 PM
$this->parser->parse('view.php',(array)$output);
However my opinion is to NOT use the template parser of codeigniter as it is really weak. You can ONLY have {something} and {/something}, nothing more, so it is not a real template parser as for example smarty .
My suggestion is to use the normal view of codeigniter ($this->load->view) as you can add your own php there or to use a template library like Phil Sturgeon's Template Library .
Posted 12 March 2012 - 12:34 PM
Thanks! it does what you said,
I'm using [b]Twig [/b]Template Engine Library for CI, i hade to use the [b]raw [/b]filter to show the html code in my view, like this: {{ output | raw }}
and its works perfectly, but when i want to edit a some record, my edit doesn't work, ... and jquery UI icons and plugins doesn't work... look at this:
http://i.imgur.com/mBMoB.jpg
when i click update button:
http://i.imgur.com/lwr1K.jpg
i have included the js and css files correctly... it's very strange :S. The problem is something about Twig i think... i suppose is complicated you know the resolve... but i'm used to using a template library.... and i don't know another place to ask it.
Thanks!
Posted 12 March 2012 - 15:30 PM
I Love GroceryCRUD!