- (11/14) Getting output from shell_exec() at all timesTAGS:Web ProgrammingWeb Server Admin
- (06/12) View Layer - Getting count of Entities in View in Cakephp 3TAGS:CakephpCake3
- (05/23) Changing URL in beforeRedirect() in Component - Cakephp 3TAGS:CakephpCake3Web Programming
- (01/28) Foundation CSS Framework ResourcesTAGS:FoundationCss
- (01/27) Change View File from Controller in CakePHP 3TAGS:CakephpCake3UsageWeb Programming
- (01/13) Loading Model/Table Anywhere in Cake3TAGS:Cake3Cakephp
- (10/06) CURL PHP 5.5 Issue on Windows (Using Twilio SDK)
Subscribe to my feed
Upgrading CakePHP Application to 1.3 (from 1.2)
Posted on 09/27/2010 at 09:33 pm by Kevin Wentworth
Viewed 10,002 times | 2 comments
I've been waiting to publish a completed article until after I was done with my upgrade to CakePHP 1.3. Well, it's taking a while. I'm not blaming the CakePHP upgrade from 1.2 to 1.3 for taking so long. I'm actually doing several large-scale changes to my code base, my server and my repository structure. Until that time, I'm going to publish some notes I've been making for this article.
CakePHP $form->create() ID Renames
Huge Gotcha! We depend on the ID of the form to perform CSS transformations and several jquery functions depend on the form ID. What's changed? Two things I've noticed:
- There is no default form ID of ModelNameEditForm. Instead, it WILL ALWAYS BE ModelNameActionForm
- Additionally, on prefix routes (i.e. admin-side), forms take on the ID of ModelNamePrefixActionForm (this one messed up some jquery)
Cache Config and Prefix
Cache::config needed a prefix set to '' otherwise it would only delete files beginning with 'cake_'. This is new behavior in that before, with no prefix set/specified it would delete all files. This left my scratching my head for a while.
If you have $session->flash();, you need to echo $session->flash();.
Router::Connect() alias now needs TWO routes
Huge change to controller aliasing via routes! After much thought and some discussion (I finally got on IRC...) I came to the realization that two routes are needed to have /controller/ route to /alias/ with ALL actions (including default/index).
Themed is now Theme! Yay!
Changing /theme/ to /theme/ for static assets (LINK TO this post). I only had to update every reference in my database to /theme/
Changing $model->del() to $model->delete. Same with $session->del(), $folder->ls().
$text->truncate() is now an array of options:
Instead of this: $summary = $text->truncate($clean_summary, 350, '...', false, true);
It will be this: $summary = $text->truncate($clean_summary, 350, array('exact'=>false, 'html'=>true));
Modifying a page title in the view?
I used to use $this->set('title', 'New Page Title');. Now you need to use $this->set('title_for_layout', 'New Page Title');
There will be more,