echo $html->link("Register", str_replace('http://', 'https://',
$html->url("/pages/register", true)));
What happens here? we use $html->url() to create a relative URL, and set the 2nd parameter to true so it will return the full URL (eg. http://domain.com/pages/register) and then replace http:// with https://, we then pass that URL to HTML helper's link() method to create a HTML link.
What happens here? we use $html->url() to create a relative URL, and set the 2nd parameter to true so it will return the full URL (eg. http://domain.com/pages/register) and then replace http:// with https://, we then pass that URL to HTML helper's link() method to create a HTML link.
Note that you don't need to do this if the originating page is already using https://. If that is the case, then all relative links will also use https:// by default.
0 comments:
Post a Comment