This behavior is the exact opposite of the CsvImport behavior included in the Utils plugin from CakeDC. This Behavior will end on github but for now, here is the source code and instructions on how to use the Behavior. (continue reading…)
CakePHP 2.0 Articles & Posts
Enable CSV Import for all controllers/models in a CakePHP 2.x project
I often use phpMyAdmin to import csv data into projects I am building, this can be tedious as phpMyAdmin requires the number of fields and field order to match exactly for the csv import to work.
This frustration prompted me to explore the (continue reading…)
[CakePHP] Modeling a simple accounting system with estimates, invoices, and payments.
Database tables and Model classes are where most CakePHP applications begin. With this example, we will focus on Model associations rather than providing a complete tutorial of an application. Consider this a solid foundation for building an Accounting Web App, this is the M in MVC.
The idea behind what we are modeling today is a simple accounting web app similar to Freshbooks or something QuickBooks offers. The model definitions and relationships are as follows. (continue reading…)
Install and reuse CakePHP across multiple projects
Update: I have created a command line tool that provides the functionality explained in detail below. Check-out CakeCore and learn more.
How to maintain one copy of each major version of the CakePHP Core library. Making upgrades to new versions of the framework effortless even across many applications.
I use CakePHP for the majority of web-based applications I create. Before developing this convention I would end up with many redundant copies of the Core library floating around taking up disk space, and making upgrade tedious. (continue reading…)
Starting a CakePHP 2.0 Project with cakeinit
The latest version of cakeinit (0.8.5) now includes support to create CakePHP 2.0 projects. To create a new project you only need two commands. This is an alternative to downloading the zip or tar.gz file and extracting.
# download cakeinit curl http://cakeinit.pronique.com/cakeinit.php -o cakeinit.php # Create an app called mycakeapp based on the cakephp-2.0 bundle php ./cakeinit.php cakephp-2.0 mycakeapp
The cakephp-1.3 bundle has also been updated to pull the recently released CakePHP 1.3.11 version of the framework. If you get some ugly permission errors don’t forget to prepend sudo to the above commands.
Read more about cakeinit at http://cakeinit.pronique.com.
Guide to CakePHP 2.0 Conventions
With the release of CakePHP 2.0 you will see some big changes. With the release of 2.0 I decided it was time to start tinkering and getting ready for 1.x migrations and will start new development with 2.x. This page serves as a quick intro and reference to these changes. If you are familiar with 1.x I’ve provided some side-by-side comparison of code. (continue reading…)