SQL Database Design For Developers at php[tek] 2024
Cakeph pppt
1. CAKEPHP
CakePHP is a free, open-source, rapid application
development(RAD) framework for PHP. It's a
foundational structure for programmers to create web
applications. Our primary goal is to enable you to work
in a structured and rapid manner–without loss of
flexibility. CakePHP takes the monotony out of web
development.
2. RAD
• RAD model is Rapid Application Development
model. It is a type of incremental model. In
RAD model the components or functions are
developed in parallel as if they were mini
projects.
3. Advantages of the RAD model:
• Reduced development time.
• Increases reusability of components
• Quick initial reviews occur
• Give support customer feedback
• Integration from very beginning solves a lot
of integration issues.
• RAD should be used when there is a need to create a
system that can be modularized in 2-3 months of time.
• It should be used if there’s high availability of designers
for modeling and the budget is high enough to afford
their cost along with the cost of automated code
generating tools.
4. • list of features you will enjoy when
using CakePHP:
• Active, friendly community
• Flexible licensing
• Compatible with versions 4 and 5 of PHP
• Integrated CRUD for database interaction
• Application scaffolding
• Code generation
• MVC architecture
• Request dispatcher with clean, custom URLs and
routes
• Built-in validation
6. Basics of CakePhp
•Folder Structure
• –App
• •Config: all configuration files
• •Models : application’s models, data sources and behaviors
• •Controllers : application’s controllers and components
• •Views : presentational files
• •Vendors : 3rdparty classes or libraries
• •Webroot: acts as document root for the application
• •Locale : stores string files for internationalization
• •Tmp: stores temporary data
• •Plugins: pluginpackages
• –Cake
• –Vendors
7. Steps
• •Creating the database
• •Creating a model
• •Creating a controller
• •Creating the views
8. Creating the database
• •Create a new table (name should be
according to the naming conventions)
• •Enter the data.
• •(Using phpmyadmin)
9. Creating a model
• •Separates the domain logic from presentation isolating
the application logic.
• •Extends AppModel(extends Model)
• •Contains data validation rules, association information and
methods specific to the table it uses.
• •For complete reference http://api.cakephp.org
• •Cakephpdynamically creates a model object
• class Book extends AppModel{
• var$name = ‘Book';
• }
• •We do can add some behaviors to each model.
10. Creating a controller
• •Manages the logic for a part of our application
• •Can access the model object by $this->Book
• class BooksControllerextends AppController{
• var$name = 'Books';
• function index() {
• $this->set('books', $this->Book->find('all'));
• }
• }
• •$this->loadModel(‘Article'); loads a different model
• •Components (packages of logic that are shared
between controllers)
16. • The webserver rewrite rules direct the request to
webroot/index.php.
• Your application’s autoloader and bootstrap files are
executed.
• Any dispatch filters that are configured can handle the
request, and optionally generate a response.
• The dispatcher selects the appropriate controller & action
based on routing rules.
• The controller’s action is called and the controller interacts
with the required Models and Components.
• The controller delegates response creation to the View to
generate the output resulting from the model data.
• The view uses Helpers and Cells to generate the response
body and headers.
• The response is sent back to the client.