2010-05-16

Getting a AJAX URL

Stupid little feature, found no where in the documentation.

If you want to create a link to a relative location in your site you would use the lithium\template\helper\html::link() method. like so:
$this->html->link('hyperlinked text','user/register');
or
$this->html->link('hyperlinked text',array('controller'=>'user','action'=>'register')); 
That and more in the lithium docs.

But the link() method will only give you back formatted html link or anchor content.  What if all you want is the href url?

 $this->url(array('controller'=>'user','action'=>'register')); 

That simple.  Just not documented.
 

No comments:

Post a Comment