Questions tagged [cakephp-2.1]

This tag relates to the 2.1.x branch of the CakePHP MVC framework.

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.[1]

The release of CakePHP 2.1 beta was announced on CakePHP official site on 2012-01-23.

The latest CakePHP stable version is 2.1.5 Security Release resolving security issues related to the XML class.

[1] From the CakePHP home page.

1009 questions
5
votes
1 answer

Cakephp 2 Security component and ajax calls

Dealing with secuity component on my ajax calls not going as they should. How do you deal with it in cakephp 2.x ? Appcontroller.php public function beforeFilter() { $this->Security->blackHoleCallback = 'blackhole'; if…
Tom
  • 3,717
  • 5
  • 26
  • 28
5
votes
4 answers

Running CakePHP Shell Script

I have created a shell script as follows out('Hello world.'); } } When i navigate to the Console folder in command line and type cake email i get the…
Harsha M V
  • 54,075
  • 125
  • 354
  • 529
5
votes
2 answers

Dynamically switching the error message on validation?

With the new validator object - is it possible to replace the validation error inside the validation rule triggered? to not only return the static error message but maybe some dynamically genereted one? public function validateLength($data) { …
mark
  • 21,691
  • 3
  • 49
  • 71
5
votes
2 answers

how to create a mock in a model test case

Maybe I am doing this wrong. I'd like to test the beforeSave method of a model (Antibody). A part of this method calls a method on an associated model (Species). I'd like to mock the Species model but don't find how. Is it possible or am I doing…
kaklon
  • 2,422
  • 2
  • 26
  • 39
5
votes
5 answers

CakePHP 2 separate login tables

I have a Cake website and it needs to have two separate logins, each one will have their own login form and see different pages, it would be nice to have two different tables because there are no similarities between the two types of people. Each…
472084
  • 17,666
  • 10
  • 63
  • 81
5
votes
1 answer

Bake tool cannot see tables in SQLite3 database

I am trying to build a simple app with CakePHP 2.1.1 using SQLite3 as the database. To save time I tried to use the bake tool to create a model for the following table: CREATE TABLE animals ( id integer primary key autoincrement, name…
Johan A.
  • 53
  • 4
5
votes
2 answers

CakePHP 2.1 .po files / translation not working

I use inside my views to display text in multiple languages. I created a .po-file directory for german: => app/Locale/ger/LC_MESSAGES/default.po msgid "this is my string" msgstr "dies ist meine…
Christian Strang
  • 8,470
  • 5
  • 42
  • 53
4
votes
3 answers

CakePHP 2.1.0: How to Create "Down for Maintenance" Page

I'm trying to implement something like Mark Story's "Down for Maintenance" page using CakePHP 2.1.0. I'm pretty close to achieving this, but I'm running into two issues that I could use some help with. First of all, here is all of the relevant code…
Nick
  • 8,049
  • 18
  • 63
  • 107
4
votes
1 answer

What's the difference between the CakePHP 2.x Plugin and plugins folders?

From CakePHP 2.0 on, the folder structure is like this: -- MyApplicationName --- app ---- Plugin ---- (other folders ...) --- lib --- plugins --- vendors Is there any difference between the Plugin-folder within the app-folder or the plugins-folder…
Stivni
  • 437
  • 1
  • 6
  • 15
4
votes
1 answer

CakePHP 2.1 doesn't work on localhost

I deployed my app on a remote host and everything works as expected. But when I try to test my code on localhost, it gives me the following error, without any change to the code working on the host: Fatal error: Class 'AppHelper' not found in…
linkyndy
  • 17,038
  • 20
  • 114
  • 194
4
votes
3 answers

Cakephp: using $this->Component->load() in component

I want to add components in an component. I've found this on the cake $this->OneTimer = $this->Components->load('OneTimer'); $this->OneTimer->getTime(); (in the fly-mehtod) But, when I try it in my controller i get the following: Fatal error: Call…
Bob
  • 873
  • 1
  • 8
  • 21
4
votes
3 answers

CakeLog doesn't write to debug.log in Shell

I wrote a shell program on CakePHP 2.1, and I wanted to write log. So I wrote like below. CakeLog::write(LOG_DEBUG, $msg); I want to write the $msg to debug.log, but it wrote to error.log. Is there someone who solve this problem? Please tell me…
4
votes
1 answer

Writing to CakePHP custom log file when in production mode

I'm trying to ensure that CakePHP writes to a custom log file when my app is in production mode. I'm writing to the log using the log method:- $this->log($url, 'payment'); This work's fine when I'm in a development mode, but when I switch to…
drmonkeyninja
  • 8,490
  • 4
  • 31
  • 59
4
votes
2 answers

What is a CakePHP Behavior?

What exactly is a CakePHP behavior? Where and how should I use it?
D555
  • 1,704
  • 6
  • 26
  • 48
4
votes
1 answer

Using email instead of username in CakePHP Auth Component

I am working on cakephp 2.x . my problem is i dont want to use username for logging .. i am taking the email and password from the user and verify this email and password from the database i have a table in my database name user and it has 3 fields…
hellojohn
  • 109
  • 1
  • 3
  • 12