zundi zundi - 1 year ago 66
PHP Question

Show full URL in emails sent using CakePHP

I'm sending emails using CakePHP. In the /View/Emails/html/newaccount.ctp file I'm doing something like:

<li>After you <?php echo $this->Html->link('log in', array('controller' => 'users', 'action' => 'login'), true); ?> to your account...</li>

however I can't get full URLs to be sent in the email.

I've also tried the following with no luck:

<li>After you <?php echo $this->Html->link('log in', array('controller' => 'users', 'action' => 'login'), array('fullBase' => true)); ?> to your account...</li>

Any tips?


Answer Source

Try this

$url = Router::url(array("controller"=>"users","action"=>"login"),true);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download