Articles récents
Commentaires récents
- In i18n routes with CakePHP 1.3
- pierre_martin wrote: Hi everyone and thank you for the feedbacks! Since this article was published, we improved...
- In i18n routes with CakePHP 1.3
- Mateusz Mucha wrote: Thank you!
- In i18n routes with CakePHP 1.3
- Piotr wrote: Wow! That's great and usefull. Ways easier than with old methods. I added some code to update...
- In i18n routes with CakePHP 1.3
- Lee wrote: Once you set $url['lang'] when empty is doesn't update $this-params with the default...
- In CakePHP Migrations plugin: easily version and deploy whole applications
- Remigijus wrote: When I am trying to run 'migration generate' for first time, my migration file 'up' has value...
Catégories
Il n'y a aucune catégorie à afficher
Mots de sagesse par Pierre Martin
-
i18n routes with CakePHP 1.3
August 05 2010 | Pierre Martin | Uncategorized
Internationalizing a CakePHP application can be tricky when it comes to deal with i18n urls. We will see in this article how the Custom route classes introduced by CakePHP 1.3 could be used to add the current language to your urls in a few lines of code. EDIT: This proof of concept has now been improved and a better version of the code below can be found in CakeDC's I18n plugin on Github Requirements This article will not go too deep in internationalizing an application as many resources already exist about it. We suppose the following: Your application defines the current language on given the language code passed in the url The available languages are configured via Configure::write('Config.languages', array('eng', 'fre', 'deu')); You use the CakePHP array syntax for defining urls: $this->Html->link('link', array('controller' => 'posts', 'action' => 'view', $post[... -
Quick start with Migrations plugin
March 01 2010 | Pierre Martin | Uncategorized
In a previous post I gave an overview of the CakePHP Migrations plugin, what it does and why you should use it in your applications. This article will explain how to use it in a practical way. We are going to bake a simple blog application recipe application and see how migrations are integrated in the development process. Since we recently moved all our open source projects on http://cakedc.github.com/, this sample application source code is also available there: Sample Migrations Application - Github (it is a CakePHP 1.3 application). Ready? Bake a new application and add the migrations plugin First of all, we need to bake a new CakePHP application. Easy enough to do using cake bake, then configure your database (an empty database is sufficient for now) and check that the home page is all green! If you have not set up your environment to use the CakePHP command line yet, take so...[ Read More | 0 Comments ]
-
CakePHP Migrations plugin: easily version and deploy whole applications
February 05 2010 | Pierre Martin | Uncategorized
This article is a quick introduction to the Migrations plugin, open sourced a few weeks ago by our company. You will see how simple it is to use the plugin and what you could do with it. I hope this article will show you the benefits of using migrations in your CakePHP applications and make you give it a try right after the reading! Here is a one-sentence description of the plugin: the Migrations plugin allows developers to easily version and automate the creation / update process of any database schema and application data from the command line. For information, CakeDC uses this plugin on its project since several years to make team collaboration and deployment easier. The plugin has been entirely rewritten a few months ago and fully tested (code coverage >95% as always at CakeDC) before being open sourced under the MIT license. It is now available to the community along with its d...[ Read More | 0 Comments ]