问题标签 [cakedc]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
584 浏览

cakephp - cakedc 搜索不起作用

我已经尝试了每一个简单的 cakedc 搜索设置,并按照之前帖子中的代码示例进行了操作,但它似乎对我不起作用。我不确定,但从我在数据库上运行的查询日志来看,似乎没有使用搜索字符串生成任何搜索查询。

当我尝试从 /books/search 搜索时,我没有得到关于我知道在数据库中的标题的结果,并且 URL 更改为 /books/index/title:sweet(我不确定这是否相关)。

任何帮助将非常感激。

模型

控制器

看法

路线

我已将 search-master 文件夹重命名为 Search 并将其放在我的插件目录中,并在我的 bootstrap.php 中加载了插件

0 投票
1 回答
120 浏览

cakephp - 如何使用 CakeDC 搜索在子表内部进行搜索?

我的父模型搜索工作正常,但我不知道如何获取查询的 Select 部分中包含的子模型/表。

使用蛋糕 2.3.8

这篇文章(如何使用 cakedc/search 插件通过 1 个搜索栏搜索 3 个不同的表?)似乎是最接近的答案,但我是 cake 新手,不太了解 @mark 的简洁答案。

任何帮助将不胜感激,谢谢!

0 投票
0 回答
36 浏览

cakephp - CakeDC 搜索已修复 Not 语句

我确信对此有一个非常简单的答案,但我没有看到它!

我正在使用 cakeDC 搜索并希望添加一个固定条件,以便Listing.status_code = drafts永远不会在返回的搜索中显示。

我在这里看过:但是由于该字段没有直接链接到表单输入,因此我不确定如何将其作为 AND 语句绑定到过滤器中?

到目前为止,这是我的代码:

0 投票
1 回答
2327 浏览

php - CakePHP Themed application and plugin view elements missing

I use CakePHP 2.4.1 and after installing CakeDC comments plugin, I got the following Notice:

Notice (1024): Element Not Found: Elements\comments\flat\main.ctp [CORE\Cake\View\View.php, line 415]

My base application is using theme. I initialize theming from the AppController beforeFilter callback as follows:

To solve this issue I tried two methods, one of them succeeded but the other is not as follows:

  1. Creating \Plugin\Comments\View\Themed\Slate\Elements and then copying all the contents of \Plugin\Comments\View\Elements to the new directory. However, this solution does not work.
  2. Copying the \Plugin\Comments\View\Elements\comments directory to \app\View\Themed\Slate\Elements. This solution is working fine. This solution works also if I copied to \app\View\Elements.

I initialze the plugin from app/Config/bootstrap.php as follows:

And from the controller as:

The following is a screen shot of the notice: enter image description here

In addition when I try to access http://mywebsite.com/comments it returns error about Action CommentsController::index() could not be found. which is rendered in missy layout that mix my themed layout and the default CakePHP layout, the following shot demonstrates it:

enter image description here

In the CakePHP manual there is no any mention about copying view files of a plugin. It should work as it is! I don't know why the plugin missed its way to its elements?! How could I make this plugin interaction correctly with the theme view of the app?

0 投票
2 回答
729 浏览

cakephp-2.0 - 如何在 cake dc 迁移中使用 ENUM?

通过使用 cake-DC 迁移,我们可以为字符串编写迁移,整数我们也可以使用 ENUM 吗???

0 投票
1 回答
252 浏览

cakephp - CakeDC Ratings 星星现在确实出现了,并且没有保存数据

我正在尝试将 CakeDC 评级添加到我的 CakePHP 网站。我已按照插件提供的自述文件中的说明进行操作,但没有出现评级星。当我按“评分”时,评分也不会保存。这是视图文件中的代码:

按“Rate”后,url 变为 '.../rate:2/redirect:1' ,但数据未出现在数据库中。我错过了什么吗?

0 投票
1 回答
208 浏览

php - 如何在 CakeDC.Ratings 插件上加载 CakeDC.Comments 插件?

我在我的应用程序中使用 CakeDC 的评级插件来允许用户对任何模型条目进行评级,例如公司表中的公司。

我还希望允许用户评论该评级。评分插件在评分表中为每个评分创建一个条目。所以我想要的是,当用户对其进行评分时,每个评分条目都应该由用户评论。在不触及插件核心的情况下,我该如何实现呢?

注意:我使用的是 Cakephp 2.4.3

0 投票
1 回答
286 浏览

cakephp - Cakephp 搜索插件 - 在相关模型中搜索

Cliente hasMany Solicitud。

我正在使用 CakeDC 搜索插件。

我需要在 Solicitud 中搜索 Cliente.nombre = "myValue" 的位置。这甚至可行吗?我粘贴我所拥有的:

我不知道这是可行的还是我在幻想。想法?

0 投票
2 回答
644 浏览

mysql - CakeDC 搜索插件不起作用

我正在尝试使用 cakedc 插件开发一个简单的搜索表单,我逐步按照说明进行操作,但出现了下一个错误:

错误:SQLSTATE[42000]:语法错误或访问冲突:1064 您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 1 行的“validateSearch”附近使用正确的语法

SQL 查询:验证搜索

我不知道我做错了什么,你能帮我吗?,这就是我所得到的,谢谢。在控制器中:

在模型中:

在视图中

0 投票
1 回答
226 浏览

cakephp-2.4 - 如何使用 CakeDC 用户插件保护访问

我想问一些关于 CakePHP 和 CakeDC 用户插件的问题……昨天我开始了我的第一个 CakePHP 应用程序(来自 CakePHP 教程的博客,没有登录用户)。太好了,一切正常。今天我安装了插件 CakeDC 用户。我可以登录,注销,更改密码,仪表板仅适用于登录用户等。一切都好。但是...如何使用此插件保护其他人的行为?例如 - 操作仪表板(舞会 cakeDC 插件)只有登录用户才能访问。动作添加(从 CakePHP 教程中将帖子添加到博客)对所有用户都是可访问的。

所以我的问题是:如何保护已登录用户的此操作(添加帖子)?

我整天都在尝试,但没有成功谢谢..