Welcome Guest, Not a member yet? Register   Sign In
HMVC+Dwoo combination possible?
#1

[eluser]cahva[/eluser]
Hi,

Before I dig deeper to this problem, I wanted to ask if someone else has succesfully got these 2 babies work together.

I installed latest HMVC and Dwoo parser.

They both work by themself but when using modules::run('foo/bar') on the HMVC side, it wont work.

If going to straight url http://mydomain/foo/bar, it will work and it goes through dwoo parser and works no problemo.

..also if I have this:
Code:
$this->parser->parse('someview',array('foo' => 'bar'));
It will work with straight url and finds the someview-view from modules/foo/views/ directory but gives file not found error when using modules::run. File not found error could be fixed just by giving the module path to parse:
Code:
$this->parser->parse('foo/someview',array('foo' => 'bar'));
..but now it will output to the contents to beginning no matter where the modules::run method is run in the view..

Oh yeah, and I'm using CI2..

PS. I just noticed that when I rename MY_Parser and use CI's own parser, it does the same: put the parsed content at the start of the script.
#2

[eluser]Phil Sturgeon[/eluser]
The Parser will output content to the output buffer when the instance is finished. As you are running two instances of CI, the first instance will most likely run and dump the content to the browser.

Try returning the parsed string instead of outputting it.

Code:
return $this->parser->parse('foo/someview',array('foo' => 'bar'), TRUE);
#3

[eluser]cahva[/eluser]
Yep now it works, thanks. Now it doesnt work with straight url but that wont be a problem as these are used(and meant to be used) as partials.




Theme © iAndrew 2016 - Forum software by © MyBB