1
I’m having a problem, I’m creating a button, which is on an X site, but the controller the action of the link is on the Y site. My problem is that when I click the button, it references the controller to action right, but the base of the site continues from Site X and not from Y.
<td> <?= (!empty($cnId)) ? $this->Html->link('Galeria', array('plugin'=>'Galeria','controller'=> 'Fotos','action' => 'index',$cnId),array('class'=>'btn btn-default')) : ''; ?> </td>
He’s linking me up http: X/galeria/fotos/index/$id
, but I wanted him to link me to Y/galeria/fotos/index/$id
. How do I do that?
According to the documentation: http://api.cakephp.org/2.1/class-HtmlHelper.html#_link
If $url starts with "http://" this is treated as an external link. Else, it is treated as a path to controller/action and parsed with the HtmlHelper::url() method.
. You have to provide some location with http:// before, otherwise it will always point "internally".– Rafael Withoeft