Javascript Window.open调用Cakephp中的操作
我想在Javascript Window.open调用Cakephp中的操作,javascript,php,html,cakephp,Javascript,Php,Html,Cakephp,我想在窗口上调用操作。打开函数 我认为: $this->Html->link( $this->Html->image('icon-picture.png', array('alt' => 'fotos', 'class'=>'link-fotos', 'onClick' => "window.open('".$this->Html->url(array('controller' => 'Pedidos' ,'action'=&g
窗口上调用操作。打开
函数
我认为:
$this->Html->link(
$this->Html->image('icon-picture.png', array('alt' => 'fotos', 'class'=>'link-fotos', 'onClick' => "window.open('".$this->Html->url(array('controller' => 'Pedidos' ,'action'=>'exibeFotos'))."', 'Pagina', 'STATUS=NO, TOOLBAR=NO, LOCATION=NO, DIRECTORIES=NO, RESISABLE=NO, SCROLLBARS=YES, TOP=10, LEFT=10, WIDTH=770, HEIGHT=400')", 'id' => 'dialogFotos')),
array('escape' => false));
但结果是:
我不明白我做错了什么。语法?选项数组必须是
$this->Html->link()
中的第三个参数。您将它作为第二个参数传递,因此它没有正确地呈现“escape=>false”
选项
试试这个:
$this->Html->link(
$this->Html->image('icon-picture.png', array('alt' => 'fotos', 'class'=>'link-fotos', 'onClick' => "window.open('".$this->Html->url(array('controller' => 'Pedidos' ,'action'=>'exibeFotos'))."', 'Pagina', 'STATUS=NO, TOOLBAR=NO, LOCATION=NO, DIRECTORIES=NO, RESISABLE=NO, SCROLLBARS=YES, TOP=10, LEFT=10, WIDTH=770, HEIGHT=400'); return false;", 'id' => 'dialogFotos')),
'#',
array('escape' => false)
);
这只是向链接添加了一个空锚,并添加了returnfalse
到onClick
事件的末尾,这样它在打开新窗口后不会跟随链接