dracoblue.net

Creating (internal) links in Agavi Views-Templates

As you set up your routing.xml with some route like that:

<route name="[strong]unnamed_ticket_view[/strong]"
    pattern="[strong]^/ticket/(id:\d+)/$[/strong]" module="Tickets" action="View" />

You can easily create links directly to that with the following code (in your

templates):

echo '<a href="'.$ro->gen("[strong]unnamed_ticket_view[/strong]", array("[strong]id[/strong]" => [strong]12[/strong]))
    .'">'.htmlspecialchars("MyLink").'</a>';

This will create a link MyLink with the target

/ticket/12/, nice, isn't it? :)

In agavi, open source, php by @ 09 Oct 2008

comments powered by Disqus

Recent Files

Advertisement

Recent Dev-Articles

Read recently

About

Blogroll