0% found this document useful (0 votes)
73 views24 pages

Chapter Five

Uploaded by

kaleb123 shumu12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views24 pages

Chapter Five

Uploaded by

kaleb123 shumu12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Chapter Five

Front-End and
Back-End
Framework
Definition
A Framework is built on the open-source language PHP and
offers built-in features to improve your software development
lifecycle.
Framework is a platform for creating PHP web applications.
 Frameworks provide libraries for commonly used functions
which reduces the steps needed to write from scratch.
 Framework provides the basic structure and components to
build web applications.
Advantage of using PHP Framework

 The MVC pattern


 Bundled Classes
 Faster development
 Better performance
 Less code
 Libraries for common operations
 Following best practices
 More secure
 Enable teamwork
 Better maintainability
Basic concepts needed to be known
before using Server Side Framework
 Knowing object-oriented PHP is also a must, as most
modern PHP frameworks are object-oriented.
 Databases and SQL syntax, since each PHP framework has
its own list of supported databases.
 Understanding an Object-Relational Mapping (ORM)
model
which is the method to access database using object oriented
syntax.
 Understanding how web servers like Apache and
Nginx works.
MVC Architecture

 PHP frameworks typically follow the Model View


Controller (MVC) design pattern.
Cont…
 The Model stores the business logic and application data and it passes data
to the View, the presentation layer.
 The User interacts with the View and can input instructions via
the Controller.
 The Controller gives these commands to the Model, and the cycle
continues.
 Generally, the Model is about data, the View is about appearance and the
Controller is about behavior.
 In PHP application terms, the MVC could correspond to the following:
Model: a database
 View: a HTML page or pages
 Controller: functions to access and update the database
Best Client Side Frameworks
 Ext JS
 Angular
 React
 Vue.js
 Ember.js
 Svelte
 Meteor
 Mithril
 Backbone.js
 Node.js
React JS
 React.js, more commonly known as React, is a free,
open-source JavaScript library.
 It works best to build user interfaces by combining
sections of code (components) into full websites.
 One of the good things about React is that you can use it
as much or as little as you want!
 React.js is built using JSX – A combination of JavaScript
and XML.
 Elements are created using JSX, then use JavaScript to
render them on your site.
Advantage of React JS

Easy to Learn and Use


Creating Dynamic Web Applications Becomes
Easier
Reusable Components
 Performance Enhancement
The Benefit of Having JavaScript Library
Scope for Testing the Codes
Disadvantage of React

The high pace of development


Poor Documentation
View Part
JSX as a barrier
Installation steps of React
 Step 1: Download node JS from (https://nodejs.org/en/download/)
 Step 2: Installing node js after downloading
 Step 3: Create a folder in xampp—htdocs-- Go to the path of your project
 Step 4: npm install –g create-react-app
 Step 5: create-react-app --version(to check the version of the react
installed)
 Step 6: create-react-app app (to create new react app in react folder)
 Step 7: cd app
 Step 8: npm start (to start the react js)
Cont..

Cd app
 npm start
Best Server Side Frameworks
 Laravel
 Symfony
 CodeIgniter
 Zend Framework
 Yii
 CakePHP
 Slim
 Phalcon
 FuelPHP
 Fat-Free Framework
Laravel
 Release in 2011
 It became the most starred PHP framework in 2015
 It focuses on the end-user first: which means it focus is on simplicity,
clarity, and getting work done.
 Designed for developers who need a simple and elegant toolkit to create
full-featured web applications.
 Laravel has a very rich set of features which will boost the speed of web
development.
 It saves a lot time if you are planning to develop a website from scratch.
 Moreover, a website built in Laravel is secure and prevents several web
attacks.
Advantages of Laravel

 The web application becomes more scalable, owing


to the Laravel framework.
 Considerable time is saved in designing the web
application, since Laravel reuses the components
from other framework in developing web application.
 It includes namespaces and interfaces, thus helps to
organize and manage resources.
Features of Laravel
 Modularity- Laravel provides 20 built in libraries and modules
which helps in enhancement of the application.
 Testability- Laravel includes features and helpers which helps in
testing through various test cases.
 Routing- Laravel provides a flexible approach to the user to define
routes in the web application.
 Configuration Management- A web application designed in
Laravel will be running on different environments, which means
that there will be a constant change in its configuration.
 Query Builder- Laravel incorporates a query builder which helps
in querying databases using various simple chain methods.
Cont…
 Schema Builder- Schema Builder maintains the database
definitions and schema in PHP code.
 Template Engine- Laravel uses the Blade Template engine, a
lightweight template language used to design hierarchical blocks and
layouts with predefined blocks that include dynamic content.
 E-mail- Laravel includes a mail class which helps in sending mail
with rich content and attachments from the web application.
 Authentication- Laravel eases designing authentication as it
includes features such as register, forgot password and send
password reminders.
Cont…
Redis- Laravel uses Redis to connect to an existing
session and general-purpose cache. Redis interacts with
session directly.
 Queues- Laravel includes queue services like emailing
large number of users
Event and Command Bus: Laravel 5.1
includes Command Bus which helps in executing
commands and dispatch events in a simple way.
Laravel Installation
Install composer first:
 Visit on www.getcomposer.org. And download composer.
 Run the setup and Install Composer
Installing Laravel:
 Type the following command in your command
prompt window:
 composer create-project –prefer dist laravel/laravel Project_name
Create Database for Project:
 Go to phpMyAdmin and create a database
Cont…
Cont…

Migrate database:
PHP artisan make migration create_databse_table:
this command is used to create the DB migration file
in your ‘database/migration’ folder.
 PHP artisan migrate: used to run the pending
migration changes to the database
Cont…

Start development server:


 PHP artisan serve: this command starts your
development server.
Cont…

 Go to the IP URL that you see on


your CMD screen.
THANK YOU!!!!

You might also like