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 at Reddit & Hackernews

Give something back

Were my blog posts useful to you? If you want to give back, support one of these charities, too!

Report hate in social media Campact e.V. With our technology and your help, we protect the oceans from plastic waste. Gesellschaft fur Freiheitsrechte e. V. The civil eye in the mediterranean

Recent Dev-Articles

Read recently

Recent Files

About