Culp http://www.Geekyboy.com In this presentation we will cover an introduction to CakePHP which I hope will allow the participants to start experimenting on their own.
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.
stuff already done, that enables a developer to create things quickly! Thus saving themselves and companies time and money. Current version: 1.3 with 2.0 coming soon Runs on: PHP 4 and 5 up to 5.3 (recommended) Has a command line tool to automate code creation for both Windows and Linux.
that utilizes an MVC design pattern. – Model = Data – View = Presentation – Controller = Logic and Direction • Config = settings files • Vendors = 3rd party and CRONs • Webroot = public – Contains the js, css, images • URL rewrite (.htaccess) makes it work
“Layout” = overall page appearance • “Elements” allow breaking up design elements from main layout. • “Pages” are handy for static content pages, where you don’t really need a controller or model. • “Routes” allow added rules to be created, and make Pages even more friendly to designers and SEO.
Initial screen prompts to “make it yours”. – Set Security.salt – Set Security.cipherseed – If PHP 5.3 set default timezone – Prefix Routing (admin, client) – Add a database • Rename ‘database.php.default’ to ‘database.php’ and customize…done! • >>> To Zend Studio
them: • Id –used as the primary key(UUID or int) • Name/Title – Cake will automatically map use this as a label in many circumstances. • Created – (datetime) Cake will automatically fill • Modified – (datetime) Cake will automatically fill • Foreign key fields = {model}_id (product_id, category_id) • >>> to phpmyadmin
command line tool called “bake” that is a great code generation tool to get you started FAST! • Make sure to add the cake console to your operating systems PATH. – Windows = manual – Ubuntu = automated if cakephp installed with apt-get • >>> To the command prompt Intro to CakePHP
• Adding ‘empty’ to dropdowns in the View. • Setting default values for checkboxes. • Using routes to simplify URLs. – Instead of ‘/pages/about’ we can use ‘/about’.
• Create a php file in the ‘app/vendors/shells’. • The ‘main’ function is always run. • Kick off via command line, and get the benefits of the CakePHP framework. (models, etc.)