Welcome Guest, Not a member yet? Register   Sign In
base_url() bug?

Hey guys, today I've discovered this peace of code that don't work.
All the parser code seems to stop working when this following command is used.

Code that not working:
$data = array( 'base' => base_url() );

Code that works:
$data['base'] = base_url();

This is when template parser is used instead of regular ($this->load->view) command.
$this->parser->parse('page', $data);

Can some one please explain why this could be happening ? Is this a bug perhaps ?

Thank you.

If $data has not been defined yet, those two definitions are exactly the same.

If $data already has stuff in it, the first option will turn $data to a new array, with only the "base" key in it.

What exactly is not working?

@Aken, I thought I've explained it above. I have no idea why its not working. $data was not previously set the code is exactly like above.

Show more code. We cant fully know what is going on without seeing it.

Alright thanks for the help guys. I've ended up using smarty template instead. It supports switch.

Theme © iAndrew 2016 - Forum software by © MyBB