CodeIgniter Forums

Full Version: Using a Anchor in the Template parser [easy?]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Dizza[/eluser]
Hey all,

Im having a problem. I think the solution is very easy but it just wont work.
The thing is im using the template parser from codeigniter but i cant use an anchor in the template parser?

Code:
$data = array(
        'logo' => '<img src="../images/cms/logo.png" />',
        'next' => '    <a href="#"><img src="../images/cms/next.png" /></a>',
        'css' => '&lt;link href="../css/cms.css" rel="stylesheet" type="text/css" /&gt;',
        'content' => echo anchor('cms/addpage', 'Add a page'); // < this is where it goes wrong
    
        $this->parser->parse('admin/page', $data);
        }

I just want to echo the link, but it just wont work, what am i doing wrong?
Am i forgetting the "" or something?

thanks

El Forum

[eluser]Zack Kitzmiller[/eluser]
Wow.. I'm..

Not really sure where to start here.

Getting rid of that 'echo' will _work_.

El Forum

[eluser]Dizza[/eluser]
[quote author="Zack Kitzmiller" date="1274398792"]Wow.. I'm..

Not really sure where to start here.

Getting rid of that 'echo' will _work_.[/quote]

I already tried that, but it wont "_work_".
I keep getting the same error:

Code:
Parse error: syntax error, unexpected ';', expecting ')' in controllers/pages.php  on line 20

Edit: I already solved it.