Creating link from one site to another in cakephp

1

I'm having a problem, I'm creating a button, which is in a site X, but the controller a action of the link is in site Y. My problem is that when I click the button, it references the controller to action right , but the site base 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>

It's linking me to http: X/galeria/fotos/index/$id , but I wanted it to link to Y/galeria/fotos/index/$id . How do I do this?

    
asked by anonymous 23.04.2015 / 21:33

2 answers

1

You can not use the routing array to refer to external links. To do this, you must enter the entire URL in the second parameter, this being a string :

echo $this->Html->link('Galeria', 'http://...', array('class'=>'btn btn-default'));
    
23.04.2015 / 21:44
0

Hello, try this:

<td> <?= (!empty($cnId)) ? $this->Html->url('Galeria', array('plugin'=>'Galeria','controller'=> 'Fotos','action' => 'index',$cnId),array('class'=>'btn btn-default')) : '';?> </td>

OU

<td> <?= (!empty($cnId)) ? $this->Html-link('http://', 'Galeria', array('plugin'=>'Galeria','controller'=> 'Fotos','action' => 'index',$cnId),array('class'=>'btn btn-default')) : '';?> </td>
    
23.04.2015 / 21:47