对于我的控制器中不需要查看的操作,我将禁用这样的布局和模板:
$this->autoRender = false;
Run Code Online (Sandbox Code Playgroud)
这一切都很好.但是,在同一个动作中,我正在回应"通过"或"失败"来表示我对结果的看法.问题是一堆文字也被回应:(我的'失败'或'通过'在最后)
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
</body>
</html>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
<head> ....
Run Code Online (Sandbox Code Playgroud)
这回应了8到9次.
我怎样才能摆脱这种情况,只有我的'通过'或'失败'才会被回应?你能帮我吗?
我试过了
$this->layout = false; and
$this->render(false);
Run Code Online (Sandbox Code Playgroud)
非常感谢.
更新:** 刚刚注意到它也无处可回复了一堆javascrip代码,(删除了<for pasting here)例如:pre class ="cake-error"a href ="javascript:void(0);" 的onclick ="的document.getElementById( 'cakeErr5035af14add0c痕量').将style.display =(document.getElemen ..
这是整个行动** …
我正在使用cakephp 2.1和cakedc搜索插件.
事情是我不能把它粘在一起.还有:
Notice (8): Indirect modification of overloaded property ProjectsController::$paginate has no effect [APP\Controller\ProjectsController.php, line 48]
Run Code Online (Sandbox Code Playgroud)
跟着cakedc教程,但有些东西不见了!简单搜索不会过滤任何东西.
我想按名称字段过滤.
在我的项目模型上
public $actsAs = array('Search.Searchable');
var $name = 'Project';
public $filterArgs = array(
array('name' => 'name', 'type' => 'like'),
array('name' => 'filter', 'type' => 'query', 'method' => 'orConditions'),
);
public function orConditions($data = array()) {
$filter = $data['filter'];
$cond = array(
'OR' => array(
$this->alias . '.name LIKE' => '%' . $filter . '%',
//$this->alias . '.body LIKE' => '%' . …
Run Code Online (Sandbox Code Playgroud)