cakephp secure link using html helper link method..
Posted
by Aaron
on Stack Overflow
See other posts from Stack Overflow
or by Aaron
Published on 2009-09-16T05:36:20Z
Indexed on
2010/04/16
1:03 UTC
Read the original article
Hit count: 399
What's the best way in cakephp to extend the html->link function so that I can tell it to output a secure(https) link? Right now, I've added my own secure_link function to app_helpers that's basically a copy of the link function but adding a https to the beginning. But it seems like there should be a better way of overriding the html->link method so that I can specify a secure option.
http://groups.google.com/group/cake-php/browse%5Fthread/thread/e801b31cd3db809a I also started a thread on the google groups and someone suggested doing something like
$html->link('my account', array('base' => 'https://', 'controller' => 'users'));
but I couldn't get that working.
Just to add, this is what is outputted when I have the above code.
<a href="/users/index/base:https:/">my account</a>
I think there's a bug in the cake/libs/router.php on line 850. There's a keyword 'bare' and I think it should be 'base' Though changing it to base doesn't seem to fix it. From what I gather, it's telling it to exclude those keys that are passed in so that they don't get included as parameters. But I'm puzzled as to why it's a 'bare' keyword and the only reason I can come up with is that it's a type.
© Stack Overflow or respective owner