How to create a link within a plug-in

Just a short tip: If you want to create a link in a plug-in to a location within the (same) plug-in you have to do it in the following way:

$html->link('link', $this->controller->base.'/mycontroller/myaction');

That will create this html snippet:

<a href="/myplugin/mycontroller/myaction">link</a>

About these ads

2 Comments

  1. Naonak
    Posted June 9, 2006 at 5:54 pm | Permalink

    Don’t work if your app isn’t in the root.

    Use this instead :

    $html->link(‘link’, ‘/’.$this->controller->plugin.’/mycontroller/myaction’);

  2. Posted June 10, 2006 at 9:33 am | Permalink

    @Naonak: Thanks for the completion!


Post a Comment

Required fields are marked *
*
*

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: