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
32
votes
7 answers

Rendering controller to a different view in CakePHP

Is there a way to render a controller to a different view then normal? I'm trying to pass some data from the controller to a non-default view. Meaning my controller is called: class StocksRealtimeController extends AppController { var $uses …
devmonster
  • 1,729
  • 8
  • 24
  • 48
31
votes
7 answers

CakePHP 2.0 - How to make custom error pages?

I read that the AppError class is now for backwards compatibility and that Exceptions should be used instead. How does one go about creating custom error pages for things like 404 errors, or completely custom errors?
BadHorsie
  • 14,135
  • 30
  • 117
  • 191
31
votes
9 answers

Using CakePHP FormHelper with Bootstrap Forms

CakePHP's FormHelper is how you generate forms when making CakePHP applications. As one might assume, this includes generating input elements, like so: $this->Form->input('abc'); Which will produce HTML something like this:
lericson
  • 1,318
  • 1
  • 12
  • 22
31
votes
10 answers

How do you specify an HTTP status code in Cakephp?

In my controller, I check a condition to see if the user is allowed to do something. If the check fails, I want to send a 403 back to the browser. How do I do that in Cakephp?
allyourcode
  • 21,871
  • 18
  • 78
  • 106
30
votes
2 answers

How can I run composer without user interaction?

I'm trying to run composer install on a cakephp installation, however it asks the user if they want to they want to set folder permissions: Note, this is an example. In production the composer install command will happen automatically via CI or…
John Hunt
  • 4,265
  • 8
  • 45
  • 59
30
votes
5 answers

Cake PHP redirect with parameters in url

I have a page that I want to redirect to that requires parameters in the URL: http://www.example.com/myController/myAction/param1:val1/param2:val2 I know that there is a CakePHP redirect function for redirecting that works as follows: …
megaboss98
  • 911
  • 1
  • 8
  • 9
29
votes
1 answer

CakePHP: Call to a member function setFlash() on a non-object

I get the following error when trying to logout of my CakePHP app: Notice (8): Undefined property: UsersController::$Session [APP/controllers/users_controller.php, line 75] Fatal error: Call to a member function setFlash() on a non-object in…
Cameron
  • 27,963
  • 100
  • 281
  • 483
29
votes
8 answers

Cakephp and Yii: similarities/differences/speed?

I am a CakePhp programmer. I have decided to try out the Yii framework. I would like to find out in what ways is CakePhp is similar to and different from Yii. Also, is Yii measurably faster than CakePhp as they claim?
aWebDeveloper
  • 36,687
  • 39
  • 170
  • 242
29
votes
5 answers

How can I debug a PHP CLI script with xdebug?

I haven't quite figured this out. EVERY piece of documentation I've found covers how to use xdebug to debug scripts running in Apache. I need to debug a php CLI script. So, for instance, how do I pass the XDEBUG_SESSION_START variable in to get…
Laran Evans
  • 1,283
  • 5
  • 15
  • 31
28
votes
1 answer

Xdebug and No Profiling Output

This is a similar problem to XDebug profiling in PHP - can't get output but mine is on windows and I have the full path specified (which solved his problem) I am not getting any output even though I have enabled the profiler. Below is a copy of…
Lizard
  • 43,732
  • 39
  • 106
  • 167
28
votes
3 answers

What new features and improvements does Lithium provide over CakePHP?

I've used CakePHP on several projects in the past, and have more recently started using Ruby on Rails, but there's a new project I'm about to start that will require PHP. While refreshing myself on CakePHP I learned that there is a new framework…
Jimmy
  • 35,686
  • 13
  • 80
  • 98
28
votes
12 answers

cakephp: How to set checkbox to checked?

I am using $form->input('Model.name', array('multiple'=>'checkbox'); I am trying to base on model data to set certain checkboxes to checked. How can i do that?
Dave
  • 281
  • 1
  • 3
  • 3
27
votes
13 answers

CakePHP check if user is logged in inside a view

I have the following code: Auth->user()) { echo $this->element('header'); } else { echo $this->element('header-bar'); } ?> inside my view which should show a different header for…
Cameron
  • 27,963
  • 100
  • 281
  • 483
27
votes
3 answers

What is PHP's session.referer_check protecting me from?

I'm making a system with CakePHP that needs to be decently secure, because we're dealing with money, customer's accounts, etc. So far everything's been working great, until I've had to integrate with a payments platform in which I need to redirect…
Daniel Magliola
  • 30,898
  • 61
  • 164
  • 243
27
votes
2 answers

Unit testing in CakePHP?

I'm wondering, how do you guys unit-test in CakePHP? How do you incorporate tests in projects? What parts of a project do you test? How do you decide which parts gets to be unit-tested? Do you guys still get to finish the job before the deadline?
user133127
  • 547
  • 8
  • 19