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
40
votes
13 answers

php e() and h() functions?

I and lately I'm seeing h() and e() functions in PHP. I have googled them, but they are so short that results don't give any idea of what they are. I got results like exponential or math related functions. For example:
nacho4d
  • 43,720
  • 45
  • 157
  • 240
40
votes
3 answers

Cakephp cake_core_ cache was unable to write 'cake_dev_en-us'

I have tried EVERYTHING but i keep getting the following cake error: ( ! ) Warning: _cake_core_ cache was unable to write 'cake_dev_en-us' to File cache in /var/www/bloglic-2013/cake/lib/Cake/Cache/Cache.php on line 309 Warning:…
Marc Rasmussen
  • 19,771
  • 79
  • 203
  • 364
39
votes
4 answers

The processing instruction target matching "[xX][mM][lL]" is not allowed

I'm outputting XML in CakePHP. But I'm getting this error when I put my XML into a validator: The processing instruction target matching "[xX][mM][lL]" is not allowed. I am using correct XML layout with Xml->header(); ?> at the…
Passionate Engineer
  • 10,034
  • 26
  • 96
  • 168
39
votes
5 answers

How do you update a cookie in PHP?

If I call setcookie() two times with the same cookie name, I get two cookies created. How do you update an existing cookie?
Cookie
  • 401
  • 1
  • 4
  • 4
39
votes
8 answers

Speeding up CakePHP

I've been a keen fan and user of CakePHP for about 2.5 years now, but the main bugbear that most fellow developers level at the framework is that it's slow, and the dispatch cycle takes too long to make it a viable solution for production…
David Yell
  • 11,756
  • 13
  • 61
  • 100
39
votes
1 answer

Cakephp check if record exists

I am wondering, is there a function that allows me to check instantly if a record in the database exists? Right now I am using the following piece of code to detect if a record exists, but I can imagine there is a simpler/better way. $conditions =…
Jelmer
  • 2,663
  • 2
  • 27
  • 45
37
votes
7 answers

base_url in CakePHP

In most web applications we need global var base_url. In cakephp to get base_url currently i put the following code on beforeRender method in app_controller.php function beforeRender(){ $this->set('base_url',…
Musa
  • 3,944
  • 4
  • 21
  • 27
36
votes
19 answers

CakePHP Database connection "Mysql" is missing, or could not be created

There have been several other posts about this, but none of the answers seemed to work for me. When I navigate to the CakePHP page on my local machine, there is one error: Cake is NOT able to connect to the database. Database connection "Mysql"…
Ben Caine
  • 1,128
  • 3
  • 15
  • 25
36
votes
3 answers

How to declare the type for local variables using PHPDoc notation?

I use Zend Studio to develop in PHP with CakePHP, and one of the problems with CakePHP is that the views all reference undeclared local variables. So for example, in the controller you would $this->set('job',new MyJobObject()); Then in the view you…
Reactgular
  • 52,335
  • 19
  • 158
  • 208
35
votes
3 answers

Loading Vendor Files in CakePHP 2.0

I'm currently upgrading one of our projects to CakePHP 2.0. Unfortunately the "first line" of code makes problems, and I can't find a solution to that problem. In CakePHP 1.3 I had an App::import("Vendor", "facebook"); statement right before the…
Johannes N.
  • 2,364
  • 3
  • 28
  • 45
35
votes
12 answers

404 Not Found The requested URL was not found on this server

I'm having small troubles and was wondering if someone can help me over the hump. I pulled a copy of a website down from Hostgator and I'm trying to set it up on my local machine using WAMP but, I keep getting an error when trying to access the…
SkillSet
  • 621
  • 2
  • 7
  • 15
34
votes
4 answers

Undefined variable: $_SESSION

I'm getting E_NOTICE errors in a core CakePHP file when it tries to reference a never-set or unset session (cake/libs/cake_session.php line 372): function read($name = null) { if (is_null($name)) { return $this->__returnSessionVars(); …
Ian Hunter
  • 9,466
  • 12
  • 61
  • 77
34
votes
12 answers

To Use a PHP Framework or Not?

I've started writing a few applications in PHP, and I'm becoming more familiar with the language. Someone told me about CakePHP, and CodeIgniter. I wanted to get a better understanding of how these could help me, and whether it's worthwhile spending…
Jonathan Lyon
  • 3,862
  • 7
  • 39
  • 52
33
votes
4 answers

Asynchronous processing or message queues in PHP (CakePHP)

I am building a website in CakePHP that processes files uploaded though an XML-RPC API and though a web frontend. Files need to be scanned by ClamAV, thumbnails need to be generated, et cetera. All resource intensive work that takes some time for…
Sander Marechal
  • 22,978
  • 13
  • 65
  • 96
32
votes
7 answers

How do I update 1 field in CakePHP?

I want a function to alter one field, "is_featured" to 1(true) of Event model of given ID, to mark an event as "Featured". class EventsController extends AppController{ function feature($id){} }
Moe Sweet
  • 3,683
  • 2
  • 34
  • 46