Questions tagged [cakephp-2.2]

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

The release of CakePHP 2.2 beta was announced CakePHP official site on April 30, 2012.

Following hot on the heels of 2.1.0, the CakePHP 2.2.0-beta was launched directly as beta as the new features were expected to be relatively stable, and could be generally transparent when upgrading.

Main features added are:

  1. Timezone support for CakeTime utility.
  2. Support pagination for complex custom finders.
  3. ACL methods now part of Permission model.
  4. New Hash class.

The latest CakePHP 2.2.x stable version is 2.2.1 release was published on July 14, 2012.

Official site: cakephp.org

Documentation: book.cakephp.org

See also:

250 questions
0
votes
1 answer

cakephp2 return one random record from database

I am experiencing a problem with my find to return a random record. The thing is, the condition is not working for some reason. DB: quotes: title (varchar255) content (varchar255) published (tinyint(1) NULL default =…
Tom
  • 3,717
  • 5
  • 26
  • 28
0
votes
2 answers

cakephp placeholder if image not exist

I have a database with images associated to each entry. Anyhow, some entries don't have an image. Googling I found some js and php way to apply in the view, but I'm pretty sure there is a (much nicer) MVC-way to do this, just I don't know how.. Is…
3und80
  • 364
  • 6
  • 20
0
votes
1 answer

Change validation error redirection at CakePHP 2.2

I have a view which interacts with more than one controller (post, comments, categories...) In case the comment is not empty, it would go to the same action (comments/add) but in this case i manually redirect them again to the previous view with…
Alvaro
  • 40,778
  • 30
  • 164
  • 336
0
votes
1 answer

Avoid CSRF with Form->postLInk at CakePHP 2.2

I am trying to use the Security component in order to avoid CSRF attacks and if i use the formHelper to create the ticket just using a postLink, like this, it fails: Form->postLink(__('Delete'), array('action' => 'delete',…
Alvaro
  • 40,778
  • 30
  • 164
  • 336
0
votes
2 answers

basic login using auth component in cakephp2.2

could you tell how to use auth component in cake2.2 to login by authenticating from the database table. As my AppController.php is: ` class AppController extends Controller { var $components = array('Auth', 'Session'); var $helpers =…
jas
  • 1
  • 1
  • 6
0
votes
1 answer

Add class to pagination links at CakePHP 2.2

I can add a class ("myclass") to the link (previous or next) which does not contain a link.(current page) I just add the class following the default ones: echo $this->Paginator->prev('< ', array(), null, array('class' => 'prev disabled…
Alvaro
  • 40,778
  • 30
  • 164
  • 336
0
votes
1 answer

print   inside postLink with CakePHP 2

i was wondering if there's any way to print " " inside a postLink element using CakePHP. I want to get something like this:   And trying this: '.$this->Form->postLink(nl2br(" "), array('action'=> 'xxxx')).' I get this…
Alvaro
  • 40,778
  • 30
  • 164
  • 336
0
votes
1 answer

Retrieving recursive data with read function at CakePHP

I have something like a blog system. Each entry can has comments. Each comment is created by a User. I am currently using the read function at my 'view' action on the controller to retrieve all the data. Relationships between models are already…
Alvaro
  • 40,778
  • 30
  • 164
  • 336
0
votes
1 answer

How can I get a URL for a controller action?

I have a link that looks like this: As you can see I'm manually…
sergserg
  • 21,716
  • 41
  • 129
  • 182
0
votes
2 answers

How to authenticate users using CakePHP 2.2?

I've read the documentation for the Authentication core library , and it's not really clear how to use it. It seems to assume a lot of prior knowledge. Specifically: You configure authentication handlers using $this->Auth->authenticate. You can…
sergserg
  • 21,716
  • 41
  • 129
  • 182
0
votes
1 answer

Problems with routes and CakePHP 2.2.2

I have installed CakePHP on windows over II7 and i am having problems with the routes. I have created a Model, a Controller and a View for Users. When i try to access the index view, i do it like this without any…
Alvaro
  • 40,778
  • 30
  • 164
  • 336
0
votes
2 answers

Custom Admin Routing - View/Admin/MyModel/index.ctp instead of View/MyModel/admin_index.ctp

In CakePHP, is there a way to set admin routing on an URL like this: ...com/admin/articles/ to go to: View/Admin/Articles/index.ctp instead of: View/Articles/admin_index.ctp My thought is, it would be nice to keep my admin files more separate…
Dave
  • 28,833
  • 23
  • 113
  • 183
0
votes
1 answer

cakephp - auto empty option on drop down list

Is there a way to "automagically" add the empty option to a drop down list? What I'm looking for is to add this option on a drop down list of a belongTo relation that can be null, without having to add code on the view. I do believe this should be a…
jplfl
  • 82
  • 11
0
votes
1 answer

MeioUpload and phpThumb() does not exist error

I am currently using CakePHP v2.2.1 and MeioUpload 4.0 along with phpThumb() to try and generate image uploads and thumbnails for those images. If i set my $actAs = array() without the thumbsizes property everything is uploaded well, but when I add…
Cameeob2003
  • 482
  • 1
  • 6
  • 16
0
votes
1 answer

How to set authError redirect action in CakePHP?

Is it a way to customize the authError URL on CakePHP? If I look into the Auth component I've placed in the AppController i have a redirect action loginRedirect and logoutRedirect but i don't know if is it possible to set something like…
vitto
  • 19,094
  • 31
  • 91
  • 130