Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums Tutorials Using HtmlHelper to generate full URLs in CakePHP
Chris
Posted on 09 Jan 2012, 17:03:29

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

In CakePHP, sometimes the need arises to generate a full URL, sending links within an email for example. To generate a full URL use the following code

<?php
echo $this->Html->url(array('controller' => 'something', 'action' => 'something'), true);
?>

To create a clickable link to the full URL, you can use the above code in conjunction with Html->link like so

<?php
echo $this->Html->link('Your text here', $this->Html->url(
    array(
        'controller' => 'something', 
        'action' => 'something'
    ), true
));
?>
#3682
Last edited by Chris at 2012-01-09 17:16:34 Reason: .
Network-13.com © 2013