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
2
votes
1 answer

Decrypt and Encrypt using CallBack Methods in cakephp

I want to use the Callbacks methods to encrypt a value before it gets stored in my database and decrypt it before showing it back in the application. I used one of the examples provided in the documentation. In my core.php I put the following :…
Qarchli Ismail
  • 147
  • 2
  • 12
2
votes
1 answer

Reusing custom validation methods in CakePHP 2.x

I want to validate in several models if a given IP and subnet make together a valid network. I wrote this custom validation function for one model: public function isValidNetwork($check=null){ if(isset($this->data[$this->name]['ip']) &&…
Michael
  • 35
  • 3
2
votes
1 answer

cakephp how to save data from dropdownlist into database table

I have created two database tables: sellers_tbls id business_name businesstype_tbls_business_type mobile businesstype_tbls id business_type where businesstype_tbls is for displying dropdown types upon registration. After submitting the form, …
2
votes
2 answers

Cakephp model find multiple 'not like'

A VARCHAR field in my db has a comma separated list of tags. I have a list of values that I want to exclude, but having trouble. This is what I was trying... $result = $this->Tags->find( 'all', 'conditions'=>array( 'fieldName NOT…
Steve Peterson
  • 132
  • 1
  • 4
  • 16
2
votes
2 answers

how to pass multiple flash messages in cakephp?

$this->Flash->set('Your college has been updated.'); I am passing flash message like above . Now i want to pass two flash messages. can anyone help me to resolve this issue..
user12342
  • 107
  • 2
  • 12
2
votes
2 answers

How do I delete a record if the primary key is not named 'id'? (CakePHP 2.x)

How do I delete a record in CakePHP 2.x when I am using an auto increment primary key named users_id instead of id? I am using the following code: $this->User->delete(12); But it is not working.
joy
  • 81
  • 1
  • 8
2
votes
2 answers

CakePHP 2.x fails to update fields recently added to a MySQL table

I have a cake application which has a table named realestate_properties in its database. I added two columns i.e. latitude and longitude to this table. On the HTML form there are already many fields, I just added the two fields named latitude and…
2
votes
2 answers

What is the proper way of setting the page title in CakePHP 2.6?

I am new to Cakephp and searching for how to set page titles and meta keywords,desc. for best SEO management. I have checked any tutorials and question , I would like to ask that is it necessary to set up title in controller page and then fetch in…
Helping Hands
  • 5,292
  • 9
  • 60
  • 127
2
votes
1 answer

Error: Non-static method DboSource::expression() should not be called statically in CakePHP 2.x

Hello everyone i have developed an application in cakephp 2.x framework.I have written a code for update & save into database using following code: public function editpackage($id=null) { $this->layout='dashboard'; …
Sahadev
  • 1,368
  • 4
  • 18
  • 39
2
votes
2 answers

How can I filter paginated results based on the value of associated models? (CakePHP 2.x)

I have 3 models in cakephp properties property id name area sub area 1 name 1 india -- 2 name 2 india -- 3 name 3 uk -- 4 name 4 pakistan …
Kamran Ali
  • 21
  • 1
2
votes
1 answer

Auth logout is not working in CakePHP 2.x

When I login from one user account session is set.Then opening the next tab on same browser and enter login url it takes me to the login page.But actually it should redirect to the "dashboard" page(in my case). It can't redirect to…
Ananthaselvam P
  • 362
  • 2
  • 4
  • 14
2
votes
1 answer

How to render a view when a (Mailjet) cURL request is finnished?

I'm stuck on this problem and can't figure out how to solve it. I'm using CakePhp 2.x, as a framework, and Mailjet to send mails, and get their status. (Mailjet is a French competitor of Mailchimp). I want to display in my index all the campaigns…
2
votes
5 answers

cakephp i18n shell not extracting validation msgs

I'm trying to generate the pot files from my site with cake's i18n shell useing cake 2.3. As mentioned in the cake docs the shell should automatically extract the validation msgs. However, none of the validation strings turn up in my pot files. My…
john23klipp
  • 506
  • 4
  • 7
2
votes
1 answer

CakePHP - 'Console/cake schema create' always inserts records to the 'default' connection and does not obey the --connection argument

I generated a schema file using the Cake console, and the schema file uses the after() method to create some default records in the database. The 'schema create' command works fine for the default database but when I tried to execute the same…
roosevelt
  • 1,874
  • 4
  • 20
  • 27
2
votes
4 answers

cakePHP - PHP EXCEL saves as .html

I have implemented PHPExcel within my CakePHP application, this is my helper:
Philip
  • 6,827
  • 13
  • 75
  • 104
1 2
3
20 21