Questions tagged [cakephp-2.x]

Questions about the 2.x branch of the CakePHP MVC framework. If your question applies to CakePHP in general, use the tag [cakephp].

Use this tag for questions specifically about version 2.x of the CakePHP MVC framework. If your question applies to CakePHP more generally, use the tag .

CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. Using commonly known design patterns like MVC and ORM within the convention over configuration paradigm, CakePHP reduces development costs and helps developers write less code.

CookBook for CakePHP 2.x

302 questions
3
votes
1 answer

How to add multiple conditions for a single column?

I have many sentences that I need filter for a same column: 'conditions' => array('Zona.nombre LIKE' => $buscar, 'Zona.nombre LIKE' => 'CUPONATIC%', 'Zona.nombre LIKE' => 'GROUPON%' ),
frtgu34
  • 99
  • 9
3
votes
2 answers

$this->request->data is empty after submitting a form in CakePHP 2.x

I'm having some problems when trying to request data that has been sent from a form. When I check $this->request->data it says its an empty array, so I thought I'd try debug($this->request) and it shows that data is array(0). I'm not sure why this…
AN11
  • 324
  • 3
  • 12
3
votes
1 answer

Prevent CakePHP from stripping chars from url passed as param?

I am developing an application using CakePHP 2.6 and having issues with passing a string containing url characters as a parameter through to a controller method. In my view I have a chunk of code which echoes out a series of table rows containing…
Daniel
  • 189
  • 9
3
votes
1 answer

CakePHP 2.x translation fallback

I need to have fallback in translation. If I have 2 translations ex.: 'eng' and 'es' Some records have both translations and some only one or none. I hoped that if I do it this way: $this->Post->locale = ['es', 'eng']; $results =…
Zbigniew Ledwoń
  • 682
  • 1
  • 6
  • 19
3
votes
2 answers

CakePHP: FlashComponent could not be found

I am using CakePHP 2.6 and trying to follow along with the simple authentication tutorial. I am using another model Account for my Auth->User. After adding in the Flash component in my AppController - I'm seeing the error message on all of my…
user2836292
  • 305
  • 2
  • 5
  • 13
3
votes
2 answers

Session->flash is not showing session message in CakePHP

I'm using CakePHP 2.6.7 and copied the code to show flash messages from one controller to another, but it's not working in the second controller. In AdminsController: function login() { $this->loadModel('Admin'); $this->layout =…
2
votes
1 answer

Retrieve total count of paginated records along side custom limit in Cake PHP 2 paginator

I'm working inside a legacy Cake PHP 2.10 application and am utilising both the Pagination component and PaginationHelper. I've had to override the paginateCount method to set a custom option for my paginator settings to limit the maximum number of…
Ryan H
  • 2,620
  • 4
  • 37
  • 109
2
votes
1 answer

How can I set the samesite cookie attribute in CakePHP 2.3?

CakePHP 2.3 sets the Session variables (including cookie attributes) in the core.php file. I need to set samesite=None and Secure=true for the session cookie, but it doesn't appear to have those settings available in the configuration, which shows…
Albert
  • 1,516
  • 3
  • 24
  • 55
2
votes
1 answer

`CakeResponse` referencing undefined variables in `compact()` call triggers errors/notices

I’m updating my first CakePHP application on a web server, but pages show errors which are at the end of this post. I can’t find the file(s) which have not uploded correctly. Thanks for help. CakePHP version : 2.9 Error messages : Notice (8):…
Uultron_10
  • 21
  • 1
  • 2
2
votes
0 answers

How to solve the memory increase in the render () loop of cakephp2

Currently, I am implementing the email sending function using Cakephp2. This time we are implementing the email sending function with our own method without using CakeEmail, and we are loading the email template using render. As a premise, this time…
2
votes
1 answer

CakePHP 2 not recognizing file uploaded via ajax

I'm having a terrible time trying to pass a file from a view to a controller using Ajax with CakePHP 2.10.7. My view has the following input:
Nadav
  • 1,055
  • 1
  • 10
  • 23
2
votes
1 answer

validate Bootstrap form in Cakephp

When i use Form Helper of Cakephp, it can be validated in Model with many rules like this: (for example) $this->validate = array( "name" => array( "rule" => "notBlank", "message" => "Name not empty !", ), …
trungducng
  • 395
  • 1
  • 7
  • 19
2
votes
1 answer

CakePHP 2.x SparkPost Plugin

I was developing one web application in cakephp 2.2.3. that application I was using CakeEmail. But Now I want to implement SparkPost plugin for email deliver. I spend lots of time in google but not getting any satisfied result. All are code I found…
Chinmay235
  • 3,236
  • 8
  • 62
  • 93
2
votes
1 answer

Set::classicExtract() CakePHP 2.x Hash:: alternative

I have an array like this: $array = array( 1234 => array( 'title' => 'TitleA', 'extra' => array( 45 => 'SubA', 54 => 'SubB', ), // More irrelevant data ), 2345 => array( …
wouter
  • 247
  • 2
  • 6
2
votes
1 answer

CakePHP: Change database connection for all models globally based on Configure value

I've 3 copies of my code - on development workstation, a test server and a production server. Accordingly, I have 3 separate DB configs in the database.php file named dev, test & production. I'm trying to figure out a way to switch the connection…
miCRoSCoPiC_eaRthLinG
  • 2,910
  • 4
  • 40
  • 56
1
2
3
20 21