Questions tagged [cakephp]

CakePHP is an open-source web, rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. It uses commonly known design patterns like MVC and ORM within the convention over configuration paradigm.

CakePHP

CakePHP is an MIT-licensed rapid development framework for that provides an extensible architecture for developing, maintaining, and deploying applications. It uses commonly-known design patterns like and within the "convention over configuration" paradigm.

##Security

CakePHP comes with built-in tools for input validation, protection, Form tampering protection, prevention, and prevention, helping you keep your application safe & secure.

##Hints

  1. To start learning this framework, there is a tutorial (CakePHP 3) / (CakePHP 2) included in its documentation. It is a very good introduction to the basics of CakePHP.

  2. Your question should name the CakePHP version you're using. Additionally it should contain a specific cake version, consider using the version-specific tag in addition to the major version tag.

##Versions

Active and stable branches

, , , , , , , , , ,

No longer supported versions

, , , , , , , , ,

##Plugins:

##Additional resources

  1. Manual https://book.cakephp.org
  2. API https://api.cakephp.org
  3. Video Tutorials https://tv.cakephp.org
  4. Articles https://bakery.cakephp.org
  5. Online Training https://training.cakephp.org/
  6. Plugins https://plugins.cakephp.org
  7. Releases https://github.com/cakephp/cakephp/tags
  8. Issues https://github.com/cakephp/cakephp/issues
  9. Inflector: https://inflector.cakephp.org/

##Get Support

  1. Slack https://cakesf.herokuapp.com/
  2. IRC https://webchat.freenode.net/?channels=#cakephp
  3. Forum https://discourse.cakephp.org/

Migration Guides If you are going to migrate from one major branch of CakePHP to another, you could check out this link and this link that lists migration guides.

31696 questions
56
votes
9 answers

symfony vs cakephp

What is conceptually the difference between symfony and cakephp?
diego
52
votes
9 answers

CakePHP: Find where field is not null

I need to select all rows where User.site_url is not null. It's simple enough to do this in a regular MySQL query but how is this done in CakePHP? The manual mentions the following: array ("not" => array ( "Post.title" => null ) ) I…
DanCake
  • 2,003
  • 4
  • 23
  • 29
51
votes
6 answers

CentOS: Enabling GD Support in PHP Installation

How do I go about enabling GD Support in a CentOS Installation?
AKKAweb
  • 3,795
  • 4
  • 33
  • 64
50
votes
22 answers

What is the equivalent to getLastInsertId() in Cakephp?

If I do getLastInsertId() immediately after a save(), it works, but otherwise it does not. This is demonstrated in my controller: function designpage() { //to create a form Untitled $this->Form->saveField('name','Untitled Form'); echo…
useranon
  • 29,318
  • 31
  • 98
  • 146
50
votes
3 answers

How to unit test your API?

I'm at the point where I need to write unit tests for a REST API written using CakePHP 1.3. The API supports GET, POST and PUT requests for querying and manipulating data. Is there any established way to test the correct input/output of an API…
deceze
  • 510,633
  • 85
  • 743
  • 889
50
votes
14 answers

How can I tell which CakePHP version is a project made with?

Is it possible to know the version of CakePHP used to generate a project with only the app code available? My problem: I downloaded a project made with CakePHP, and I really can't tell which Cake version to use. The files say, e.g. @version …
Mauricio Pasquier Juan
  • 2,265
  • 3
  • 27
  • 39
49
votes
7 answers

Is PHP Object-oriented?

Is PHP an object-oriented language? If not, then what about the framework CakePHP? Is it an object-oriented MVC implementation of PHP? Also, can a PHP application wholly built using classes be called object-oriented?
avon_verma
  • 1,229
  • 3
  • 12
  • 17
48
votes
1 answer

How to store repeating dates keeping in mind Daylight Savings Time

I'm storing events in my database. I have 'start' and 'end' date times, 'tickets_start' and 'tickets_end' (for when ticket sales actually start/end - as opposed to the start/end of the actual event). So far, I've built methods that do all the fun…
Dave
  • 28,833
  • 23
  • 113
  • 183
48
votes
3 answers

PHPUnit's returnValueMap not yielding expected results

I'm trying to use PHPUnit's returnValueMap() to stub out the results of a read. It isn't yielding the expected results, but an equivalent returnCallback() does. I've made my test case available if you'd like to inspect it…
Brad Koch
  • 19,267
  • 19
  • 110
  • 137
47
votes
12 answers

What is a .ctp file used for in CakePHP?

I'm starting to use CakePHP, and I'm in the process of reading the manual. About halfway down the page, there's this comment: // Render the element in /views/elements/ajaxreturn.ctp So a very simple question: what's the .ctp extension refer to? …
Dirk
  • 6,774
  • 14
  • 51
  • 73
45
votes
11 answers

CakePHP - get last query run

I want to get the last query CakePHP ran. I can't turn debug on in core.php and I can't run the code locally. I need a way to get the last sql query and log it to the error log without effecting the live site. This query is failing but is being…
Phantz
44
votes
3 answers

CakePHP find method with JOIN

Hi, I need to do the following query using the CakePHP find method: SELECT * FROM `messages` INNER JOIN users ON messages.from = users.id WHERE messages.to = 4 ORDER BY messages.datetime DESC Basically I have: messages table with a Message…
geoffs3310
  • 13,640
  • 23
  • 64
  • 85
43
votes
2 answers

Display CTP Files as PHP Files in PHPStorm

I have a project running on CakePHP. All of my views are stored as ctp files. How do I render my ctp files so I have the same visual formatting that's present when I look at a file that is stored as a PHP file? In Notepad++, I was able to do this…
Lloyd Banks
  • 35,740
  • 58
  • 156
  • 248
42
votes
3 answers

how we add or remove readonly attribute from textbox on clicking radion button in cakephp using jquery?

Here is my cakephp generated HTML radio box and text box script: Yes
Pank
  • 13,800
  • 10
  • 32
  • 45
40
votes
7 answers

save() returning false, but with no error in CakePHP

My debug value is set to 2, and it's displaying all the queries, except the one I need. I have an Items controller method that is calling this method in the User model (Item belongsTo User): function add_basic($email, $password) { …
Dan
  • 401
  • 1
  • 4
  • 3