SlideShare a Scribd company logo
Object-Oriented
Programming

(with Laravel)
By: Shahrzad Peyman
Session 1
March-2017
shahrzad.peymaan@gmail.com
1
Today’s Presentation
▪ What is PHP?
▪ Object Oriented Programming
▪ Introduction to PHP Syntax
▪ Composer
▪ Framework
▪ MVC
▪ Laravel
2
What is PHP?
▪ PHP is a popular, general-purpose and server-side scripting
language that is especially suited to web development.
▪ Commonly used to build web applications.
▪ PHP: Personal Home Page --- Php Hypertext Preprocessor
▪ PHP (Hypertext Preprocessor) was created by Rasmus Lerdorf in
1994. It is now developed and improved by a large team of
people.
▪ http://www.php.net
3
PHP History
PHP2 1995 Added database support, file uploads,
variables, arrays, recursive functions,
conditionals, iterations, regular expression and
etc.
PHP3 1998 Added support of ODBC data sources, multiple
platform support, email protocol, and new parser
written by Zeev Suraski and Andi Gutmans.
PHP4 2000 The parser was renamed the Zend Engine. Many
security features were added.
PHP5 2004 Adds Zend Engine 2 with object oriented
programming, robust XML support, SOAP
extension for interoperability with Web Services,
SQLLite has been bundled with PHP.
PHP7 2015 Revolution in PHP
4
Scripting Language
▪ A scripting language is a programming language that employs a
high-level construct to interpret and execute one command at a
time.
▪ Interpreted at runtime
5
Who Uses PHP?
▪ Yahoo!
▪ Facebook (HACK)
▪ Wikipedia
▪ 20+ million other domain names
6
Which Tools Based on PHP?
▪ Wordpress (Blog engine)
▪ Drupal (CMS)
▪ Slack (Chat Service)
▪ Joomla (CMS)
➢As of January 2013, PHP was used in more than 240
million websites (39% of those sampled) and was installed on
2.1 million web servers.
7
Why I Choose PHP?
▪ Cost nothing, it is free to download and use.
▪ Open source
▪ Runs on different platforms
▪ Codes and solutions are easily available
▪ Lots and lots of knowledge and documentation
▪ Speed of development
8
Working of PHP?
9
Object-Oriented Programming
What is Object-Oriented Programming (OOP)?
Object-oriented programming (OOP) is a programming paradigm
based on the concept of "objects".
So,
Objects are key to understanding object-oriented technology.
10
What is Object?
❖Many examples of real-world objects
▪ your Book, your PC, your Mobile, your Computer mouse and so on.
❖Real-world objects share two characteristics:
▪ State
▪ Behavior
❖Software Objects
▪ Modeled after real-world objects.
▪ Maintains its states in variables or attributes.
▪ Implements its behaviors with methods.
11
Objects
▪ E.g. A Computer Mouse is a real-world Object. Its states would be
its color, size and brand name and its behaviors would be left-
click, right-click and middle click.
▪ Software object that modeled your real-world computer mouse.
▪ Have variables(attributes) that indicated the computer mouse’s current
states:
▪ Its color is black.
▪ Its size is medium.
▪ Its brand name is Genius.
▪ Have methods that indicated the computer mouse’s current behaviors
like left-click, right-click and middle click.
12
What is Class?
▪ A class is a prototype that defines the variables and the methods
common to all objects of a certain kind.
▪ A class is an entity that helps the programmer to define a new
complex data type.
➢An object is an instance of a class.
➢A class defines the data and behavior of objects.
➢E.g. Apple, Orange and banana are members of the fruit class.
13
Introduction to PHP Syntax
▪ PHP has quality easy syntax. If you are familiar with any c-type
language
▪ It has all the same structures that you are familiar with other
programming languages
▪ PHP is designed to output to browser, but it is possible to do also
CLI apps
14
Variables
▪ Variables in PHP are represented by a dollar sign ($).
▪ PHP supports nine main types:
▪ boolean
▪ integer
▪ float
▪ double
▪ string
▪ array
▪ object
▪ resource
▪ NULL
▪ Case-sensitivity
▪ Start with letter or _
▪ After that you can have numbers, letters and _
15
Booleans
▪ Simple Type
▪ A boolean expresses a truth value. It can be either TRUE or False
(case-insensitive).
16
Integers
▪ An integer is a number of the Set Z = { … , -2 , -1 , 0 , 1 , 2 , … }
▪ Integers can be specified in decimal (base 10), hexadecimal
(base 16), octal (base 8) or binary (base 2) notation, optionally
preceded by a sign ( - or + ).
17
Array
▪ An array in PHP is actually an ordered map. A map is a type that
associates values to keys.
▪ This type is optimized for several different uses:
▪ Array
▪ List (vector)
▪ Hash table
▪ Dictionary
▪ Collection
▪ Stack
▪ Queue
▪ …
18
NULL
▪ The special Null value represents a variable with no value.
▪ NULL is the only possible value of type null.
▪ A variable is considered to be null if:
▪ It has been assigned the constant NULL.
▪ It has not been set to any value yet.
▪ It has been unset()
19
Functions
▪ A function may be defined using syntax such as the following:
▪ Any valid PHP code may appear inside a function, even other
functions.
20
Class in PHP
▪ Basic class definitions begin with the keyword class, followed by
a class name
▪ Then, followed by a pair of curly braces which enclose the
definitions of the properties and methods belonging to the class.
21
Object in PHP
▪ Instance of class
22
Namespace
▪ Provide a way in which to group related classes, functions,
constants and others.
▪ An abstract concept in many places.
▪ In PHP world, namespaces are designed to solve two problems:
▪ Name collisions between code you create
▪ Improving readability of source code (Ability to alias)
23
Composer
▪ Composer is a tool for dependency management in PHP. It allows
you to declare the libraries your project depends on and it will
manage (install/update) them for you.
▪ Use:
▪ Install Composer
▪ In root of your project, Create a text file (JSON File) – composer.json
▪ Require all libraries you want to use it
▪ Composer install
24
What is Framework?
▪ An application framework is a software library that provides a
fundamental structure to support the development
of applications for a specific environment.
▪ In computer systems, a framework is often a layered structure
indicating what kind of programs can or should be built and how
they would interrelate.
▪ A PHP Framework is a basic platform that allows us to develop
web applications. In other words, it provides structure. By using
a PHP Framework, you will end up saving loads of time, stopping
the need to produce repetitive code, and you'll be able to build
applications rapidly (RAD).
25
MVC: Model-View-Controller
▪ Model–View–Controller (MVC) is a software design pattern for
implementing user interfaces on computers.
▪ It divides a given application into three interconnected parts in
order to separate internal representations of information from the
ways that information is presented to and accepted from the user.
▪ Popular programming languages like Java, C#, Ruby, PHP and
others have popular MVC frameworks.
26
Laravel
▪ Laravel is a free, open-source PHP web framework created by
Taylor Otwell.
▪ Intended for the development of web applications following
the model–view–controller (MVC) architectural pattern.
➢As of March 2015, Laravel is regarded as one of the most
popular PHP frameworks, together
with Symfony2, Nette, CodeIgniter, Yii2 and other frameworks.
27
Laravel Requirements:
▪ The Laravel framework has a few system requirements:
▪ PHP >= 5.6.4
▪ OpenSSL PHP Extension
▪ PDO PHP Extension
▪ Mbstring PHP Extension
▪ Tokenizer PHP Extension
▪ XML PHP Extension
Laravel utilizes Composer to manage its dependencies. So, before
using Laravel, make sure you have Composer installed on your
machine.
28
Install Laravel
▪ First, download the Laravel installer using Composer:
▪ composer global require "laravel/installer“
▪ laravel new blog
29

More Related Content

What's hot

Projects In Laravel : Learn Laravel Building 10 Projects
Projects In Laravel : Learn Laravel Building 10 ProjectsProjects In Laravel : Learn Laravel Building 10 Projects
Projects In Laravel : Learn Laravel Building 10 Projects
Sam Dias
 
Laravel Presentation
Laravel PresentationLaravel Presentation
Laravel Presentation
REZAUL KARIM REFATH
 
Introduction to laravel framework
Introduction to laravel frameworkIntroduction to laravel framework
Introduction to laravel framework
Ahmad Fatoni
 
REST APIs in Laravel 101
REST APIs in Laravel 101REST APIs in Laravel 101
REST APIs in Laravel 101
Samantha Geitz
 
Laravel
LaravelLaravel
Laravel
Dyuti Islam
 
What-is-Laravel-23-August-2017.pptx
What-is-Laravel-23-August-2017.pptxWhat-is-Laravel-23-August-2017.pptx
What-is-Laravel-23-August-2017.pptx
AbhijeetKumar456867
 
Aula 02 - Introdução ao PHP
Aula 02 - Introdução ao PHPAula 02 - Introdução ao PHP
Aula 02 - Introdução ao PHP
Daniel Brandão
 
Laravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web ArtisansLaravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web Artisans
Windzoon Technologies
 
Why Laravel?
Why Laravel?Why Laravel?
Why Laravel?
Jonathan Goode
 
01 php - introdução ao php
01   php - introdução ao php01   php - introdução ao php
01 php - introdução ao php
Roney Sousa
 
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js + Expres...
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js +  Expres...Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js +  Expres...
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js + Expres...
Edureka!
 
Laravel Tutorial PPT
Laravel Tutorial PPTLaravel Tutorial PPT
Laravel Tutorial PPT
Piyush Aggarwal
 
Introduction au Framework Laravel
Introduction au Framework LaravelIntroduction au Framework Laravel
Introduction au Framework Laravel
Houcem Hedhly
 
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Dilouar Hossain
 
Node.js e Express
Node.js e ExpressNode.js e Express
Node.js e Express
Dan Vitoriano
 
FYBSC IT Web Programming Unit IV PHP and MySQL
FYBSC IT Web Programming Unit IV  PHP and MySQLFYBSC IT Web Programming Unit IV  PHP and MySQL
FYBSC IT Web Programming Unit IV PHP and MySQL
Arti Parab Academics
 
Programação Web com PHP 7.x
Programação Web com PHP 7.xProgramação Web com PHP 7.x
Programação Web com PHP 7.x
Norton Guimarães
 
Web Development with Laravel 5
Web Development with Laravel 5Web Development with Laravel 5
Web Development with Laravel 5
Soheil Khodayari
 
Laravel Blade Template
Laravel Blade TemplateLaravel Blade Template
Laravel Blade Template
Mindfire Solutions
 
PHP
PHPPHP

What's hot (20)

Projects In Laravel : Learn Laravel Building 10 Projects
Projects In Laravel : Learn Laravel Building 10 ProjectsProjects In Laravel : Learn Laravel Building 10 Projects
Projects In Laravel : Learn Laravel Building 10 Projects
 
Laravel Presentation
Laravel PresentationLaravel Presentation
Laravel Presentation
 
Introduction to laravel framework
Introduction to laravel frameworkIntroduction to laravel framework
Introduction to laravel framework
 
REST APIs in Laravel 101
REST APIs in Laravel 101REST APIs in Laravel 101
REST APIs in Laravel 101
 
Laravel
LaravelLaravel
Laravel
 
What-is-Laravel-23-August-2017.pptx
What-is-Laravel-23-August-2017.pptxWhat-is-Laravel-23-August-2017.pptx
What-is-Laravel-23-August-2017.pptx
 
Aula 02 - Introdução ao PHP
Aula 02 - Introdução ao PHPAula 02 - Introdução ao PHP
Aula 02 - Introdução ao PHP
 
Laravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web ArtisansLaravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web Artisans
 
Why Laravel?
Why Laravel?Why Laravel?
Why Laravel?
 
01 php - introdução ao php
01   php - introdução ao php01   php - introdução ao php
01 php - introdução ao php
 
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js + Expres...
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js +  Expres...Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js +  Expres...
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js + Expres...
 
Laravel Tutorial PPT
Laravel Tutorial PPTLaravel Tutorial PPT
Laravel Tutorial PPT
 
Introduction au Framework Laravel
Introduction au Framework LaravelIntroduction au Framework Laravel
Introduction au Framework Laravel
 
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
 
Node.js e Express
Node.js e ExpressNode.js e Express
Node.js e Express
 
FYBSC IT Web Programming Unit IV PHP and MySQL
FYBSC IT Web Programming Unit IV  PHP and MySQLFYBSC IT Web Programming Unit IV  PHP and MySQL
FYBSC IT Web Programming Unit IV PHP and MySQL
 
Programação Web com PHP 7.x
Programação Web com PHP 7.xProgramação Web com PHP 7.x
Programação Web com PHP 7.x
 
Web Development with Laravel 5
Web Development with Laravel 5Web Development with Laravel 5
Web Development with Laravel 5
 
Laravel Blade Template
Laravel Blade TemplateLaravel Blade Template
Laravel Blade Template
 
PHP
PHPPHP
PHP
 

Similar to Object Oriented Programming with Laravel - Session 1

Programming paradigm and web programming
Programming paradigm and web programmingProgramming paradigm and web programming
Programming paradigm and web programming
Mohammad Kamrul Hasan
 
Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1ADARSH BHATT
 
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdf
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdfTop 8 Powerful Tools Developers Use for Laravel Web Development.pdf
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdf
MoonTechnolabsPvtLtd
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdf
burasyacob012
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)
Dastan Kamaran
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)
Dastan Kamaran
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
Eric Johnson
 
PHP TRAINING
PHP TRAININGPHP TRAINING
PHP TRAINING
gurjinderbains
 
Exploring PHP's Built-in Functions
Exploring PHP's Built-in FunctionsExploring PHP's Built-in Functions
Exploring PHP's Built-in Functions
Emma Thompson
 
Programming language
Programming languageProgramming language
Programming language
MalayKalavadia
 
Node.js vs PHP, What should SMBs prefer for web development.pdf
Node.js vs PHP, What should SMBs prefer for web development.pdfNode.js vs PHP, What should SMBs prefer for web development.pdf
Node.js vs PHP, What should SMBs prefer for web development.pdf
Mindfire LLC
 
Top 10 php frameworks in 2021
Top 10 php frameworks in 2021Top 10 php frameworks in 2021
Top 10 php frameworks in 2021
MaryamAnwar10
 
PHP Jump Start
PHP Jump StartPHP Jump Start
PHP Jump Start
Haim Michael
 
Laravel level 0 (introduction)
Laravel level 0 (introduction)Laravel level 0 (introduction)
Laravel level 0 (introduction)
Kriangkrai Chaonithi
 
DOT NET TRaining
DOT NET TRainingDOT NET TRaining
DOT NET TRaining
sunil kumar
 
OOP Java
OOP JavaOOP Java
OOP Java
Saif Kassim
 
Web technology html5 php_mysql
Web technology html5 php_mysqlWeb technology html5 php_mysql
Web technology html5 php_mysql
durai arasan
 
Lists of PHP web Development Tools.pdf
Lists of PHP web Development Tools.pdfLists of PHP web Development Tools.pdf
Lists of PHP web Development Tools.pdf
mithranmithran1
 
Week 5
Week 5Week 5
Week 5A VD
 
Introduction to PHP (SDPHP)
Introduction to PHP   (SDPHP)Introduction to PHP   (SDPHP)
Introduction to PHP (SDPHP)
Eric Johnson
 

Similar to Object Oriented Programming with Laravel - Session 1 (20)

Programming paradigm and web programming
Programming paradigm and web programmingProgramming paradigm and web programming
Programming paradigm and web programming
 
Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1
 
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdf
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdfTop 8 Powerful Tools Developers Use for Laravel Web Development.pdf
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdf
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdf
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
 
PHP TRAINING
PHP TRAININGPHP TRAINING
PHP TRAINING
 
Exploring PHP's Built-in Functions
Exploring PHP's Built-in FunctionsExploring PHP's Built-in Functions
Exploring PHP's Built-in Functions
 
Programming language
Programming languageProgramming language
Programming language
 
Node.js vs PHP, What should SMBs prefer for web development.pdf
Node.js vs PHP, What should SMBs prefer for web development.pdfNode.js vs PHP, What should SMBs prefer for web development.pdf
Node.js vs PHP, What should SMBs prefer for web development.pdf
 
Top 10 php frameworks in 2021
Top 10 php frameworks in 2021Top 10 php frameworks in 2021
Top 10 php frameworks in 2021
 
PHP Jump Start
PHP Jump StartPHP Jump Start
PHP Jump Start
 
Laravel level 0 (introduction)
Laravel level 0 (introduction)Laravel level 0 (introduction)
Laravel level 0 (introduction)
 
DOT NET TRaining
DOT NET TRainingDOT NET TRaining
DOT NET TRaining
 
OOP Java
OOP JavaOOP Java
OOP Java
 
Web technology html5 php_mysql
Web technology html5 php_mysqlWeb technology html5 php_mysql
Web technology html5 php_mysql
 
Lists of PHP web Development Tools.pdf
Lists of PHP web Development Tools.pdfLists of PHP web Development Tools.pdf
Lists of PHP web Development Tools.pdf
 
Week 5
Week 5Week 5
Week 5
 
Introduction to PHP (SDPHP)
Introduction to PHP   (SDPHP)Introduction to PHP   (SDPHP)
Introduction to PHP (SDPHP)
 

More from Shahrzad Peyman

Web Design & Development - Session 9
Web Design & Development - Session 9Web Design & Development - Session 9
Web Design & Development - Session 9
Shahrzad Peyman
 
Web Design & Development - Session 8
Web Design & Development - Session 8Web Design & Development - Session 8
Web Design & Development - Session 8
Shahrzad Peyman
 
Web Design & Development - Session 7
Web Design & Development - Session 7Web Design & Development - Session 7
Web Design & Development - Session 7
Shahrzad Peyman
 
Web Design & Development - Session 6
Web Design & Development - Session 6Web Design & Development - Session 6
Web Design & Development - Session 6
Shahrzad Peyman
 
Web Design & Development - Session 4
Web Design & Development - Session 4Web Design & Development - Session 4
Web Design & Development - Session 4
Shahrzad Peyman
 
Web Design & Development - Session 3
Web Design & Development - Session 3Web Design & Development - Session 3
Web Design & Development - Session 3
Shahrzad Peyman
 
Web Design & Development - Session 2
Web Design & Development - Session 2Web Design & Development - Session 2
Web Design & Development - Session 2
Shahrzad Peyman
 
Web Design & Development - Session 1
Web Design & Development - Session 1Web Design & Development - Session 1
Web Design & Development - Session 1
Shahrzad Peyman
 
Object Oriented Programming with Laravel - Session 6
Object Oriented Programming with Laravel - Session 6Object Oriented Programming with Laravel - Session 6
Object Oriented Programming with Laravel - Session 6
Shahrzad Peyman
 
Object Oriented Programming with Laravel - Session 5
Object Oriented Programming with Laravel - Session 5Object Oriented Programming with Laravel - Session 5
Object Oriented Programming with Laravel - Session 5
Shahrzad Peyman
 
Object Oriented Programming with Laravel - Session 4
Object Oriented Programming with Laravel - Session 4Object Oriented Programming with Laravel - Session 4
Object Oriented Programming with Laravel - Session 4
Shahrzad Peyman
 

More from Shahrzad Peyman (11)

Web Design & Development - Session 9
Web Design & Development - Session 9Web Design & Development - Session 9
Web Design & Development - Session 9
 
Web Design & Development - Session 8
Web Design & Development - Session 8Web Design & Development - Session 8
Web Design & Development - Session 8
 
Web Design & Development - Session 7
Web Design & Development - Session 7Web Design & Development - Session 7
Web Design & Development - Session 7
 
Web Design & Development - Session 6
Web Design & Development - Session 6Web Design & Development - Session 6
Web Design & Development - Session 6
 
Web Design & Development - Session 4
Web Design & Development - Session 4Web Design & Development - Session 4
Web Design & Development - Session 4
 
Web Design & Development - Session 3
Web Design & Development - Session 3Web Design & Development - Session 3
Web Design & Development - Session 3
 
Web Design & Development - Session 2
Web Design & Development - Session 2Web Design & Development - Session 2
Web Design & Development - Session 2
 
Web Design & Development - Session 1
Web Design & Development - Session 1Web Design & Development - Session 1
Web Design & Development - Session 1
 
Object Oriented Programming with Laravel - Session 6
Object Oriented Programming with Laravel - Session 6Object Oriented Programming with Laravel - Session 6
Object Oriented Programming with Laravel - Session 6
 
Object Oriented Programming with Laravel - Session 5
Object Oriented Programming with Laravel - Session 5Object Oriented Programming with Laravel - Session 5
Object Oriented Programming with Laravel - Session 5
 
Object Oriented Programming with Laravel - Session 4
Object Oriented Programming with Laravel - Session 4Object Oriented Programming with Laravel - Session 4
Object Oriented Programming with Laravel - Session 4
 

Recently uploaded

2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
abdulrafaychaudhry
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 

Recently uploaded (20)

2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 

Object Oriented Programming with Laravel - Session 1

  • 1. Object-Oriented Programming
 (with Laravel) By: Shahrzad Peyman Session 1 March-2017 shahrzad.peymaan@gmail.com 1
  • 2. Today’s Presentation ▪ What is PHP? ▪ Object Oriented Programming ▪ Introduction to PHP Syntax ▪ Composer ▪ Framework ▪ MVC ▪ Laravel 2
  • 3. What is PHP? ▪ PHP is a popular, general-purpose and server-side scripting language that is especially suited to web development. ▪ Commonly used to build web applications. ▪ PHP: Personal Home Page --- Php Hypertext Preprocessor ▪ PHP (Hypertext Preprocessor) was created by Rasmus Lerdorf in 1994. It is now developed and improved by a large team of people. ▪ http://www.php.net 3
  • 4. PHP History PHP2 1995 Added database support, file uploads, variables, arrays, recursive functions, conditionals, iterations, regular expression and etc. PHP3 1998 Added support of ODBC data sources, multiple platform support, email protocol, and new parser written by Zeev Suraski and Andi Gutmans. PHP4 2000 The parser was renamed the Zend Engine. Many security features were added. PHP5 2004 Adds Zend Engine 2 with object oriented programming, robust XML support, SOAP extension for interoperability with Web Services, SQLLite has been bundled with PHP. PHP7 2015 Revolution in PHP 4
  • 5. Scripting Language ▪ A scripting language is a programming language that employs a high-level construct to interpret and execute one command at a time. ▪ Interpreted at runtime 5
  • 6. Who Uses PHP? ▪ Yahoo! ▪ Facebook (HACK) ▪ Wikipedia ▪ 20+ million other domain names 6
  • 7. Which Tools Based on PHP? ▪ Wordpress (Blog engine) ▪ Drupal (CMS) ▪ Slack (Chat Service) ▪ Joomla (CMS) ➢As of January 2013, PHP was used in more than 240 million websites (39% of those sampled) and was installed on 2.1 million web servers. 7
  • 8. Why I Choose PHP? ▪ Cost nothing, it is free to download and use. ▪ Open source ▪ Runs on different platforms ▪ Codes and solutions are easily available ▪ Lots and lots of knowledge and documentation ▪ Speed of development 8
  • 10. Object-Oriented Programming What is Object-Oriented Programming (OOP)? Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects". So, Objects are key to understanding object-oriented technology. 10
  • 11. What is Object? ❖Many examples of real-world objects ▪ your Book, your PC, your Mobile, your Computer mouse and so on. ❖Real-world objects share two characteristics: ▪ State ▪ Behavior ❖Software Objects ▪ Modeled after real-world objects. ▪ Maintains its states in variables or attributes. ▪ Implements its behaviors with methods. 11
  • 12. Objects ▪ E.g. A Computer Mouse is a real-world Object. Its states would be its color, size and brand name and its behaviors would be left- click, right-click and middle click. ▪ Software object that modeled your real-world computer mouse. ▪ Have variables(attributes) that indicated the computer mouse’s current states: ▪ Its color is black. ▪ Its size is medium. ▪ Its brand name is Genius. ▪ Have methods that indicated the computer mouse’s current behaviors like left-click, right-click and middle click. 12
  • 13. What is Class? ▪ A class is a prototype that defines the variables and the methods common to all objects of a certain kind. ▪ A class is an entity that helps the programmer to define a new complex data type. ➢An object is an instance of a class. ➢A class defines the data and behavior of objects. ➢E.g. Apple, Orange and banana are members of the fruit class. 13
  • 14. Introduction to PHP Syntax ▪ PHP has quality easy syntax. If you are familiar with any c-type language ▪ It has all the same structures that you are familiar with other programming languages ▪ PHP is designed to output to browser, but it is possible to do also CLI apps 14
  • 15. Variables ▪ Variables in PHP are represented by a dollar sign ($). ▪ PHP supports nine main types: ▪ boolean ▪ integer ▪ float ▪ double ▪ string ▪ array ▪ object ▪ resource ▪ NULL ▪ Case-sensitivity ▪ Start with letter or _ ▪ After that you can have numbers, letters and _ 15
  • 16. Booleans ▪ Simple Type ▪ A boolean expresses a truth value. It can be either TRUE or False (case-insensitive). 16
  • 17. Integers ▪ An integer is a number of the Set Z = { … , -2 , -1 , 0 , 1 , 2 , … } ▪ Integers can be specified in decimal (base 10), hexadecimal (base 16), octal (base 8) or binary (base 2) notation, optionally preceded by a sign ( - or + ). 17
  • 18. Array ▪ An array in PHP is actually an ordered map. A map is a type that associates values to keys. ▪ This type is optimized for several different uses: ▪ Array ▪ List (vector) ▪ Hash table ▪ Dictionary ▪ Collection ▪ Stack ▪ Queue ▪ … 18
  • 19. NULL ▪ The special Null value represents a variable with no value. ▪ NULL is the only possible value of type null. ▪ A variable is considered to be null if: ▪ It has been assigned the constant NULL. ▪ It has not been set to any value yet. ▪ It has been unset() 19
  • 20. Functions ▪ A function may be defined using syntax such as the following: ▪ Any valid PHP code may appear inside a function, even other functions. 20
  • 21. Class in PHP ▪ Basic class definitions begin with the keyword class, followed by a class name ▪ Then, followed by a pair of curly braces which enclose the definitions of the properties and methods belonging to the class. 21
  • 22. Object in PHP ▪ Instance of class 22
  • 23. Namespace ▪ Provide a way in which to group related classes, functions, constants and others. ▪ An abstract concept in many places. ▪ In PHP world, namespaces are designed to solve two problems: ▪ Name collisions between code you create ▪ Improving readability of source code (Ability to alias) 23
  • 24. Composer ▪ Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. ▪ Use: ▪ Install Composer ▪ In root of your project, Create a text file (JSON File) – composer.json ▪ Require all libraries you want to use it ▪ Composer install 24
  • 25. What is Framework? ▪ An application framework is a software library that provides a fundamental structure to support the development of applications for a specific environment. ▪ In computer systems, a framework is often a layered structure indicating what kind of programs can or should be built and how they would interrelate. ▪ A PHP Framework is a basic platform that allows us to develop web applications. In other words, it provides structure. By using a PHP Framework, you will end up saving loads of time, stopping the need to produce repetitive code, and you'll be able to build applications rapidly (RAD). 25
  • 26. MVC: Model-View-Controller ▪ Model–View–Controller (MVC) is a software design pattern for implementing user interfaces on computers. ▪ It divides a given application into three interconnected parts in order to separate internal representations of information from the ways that information is presented to and accepted from the user. ▪ Popular programming languages like Java, C#, Ruby, PHP and others have popular MVC frameworks. 26
  • 27. Laravel ▪ Laravel is a free, open-source PHP web framework created by Taylor Otwell. ▪ Intended for the development of web applications following the model–view–controller (MVC) architectural pattern. ➢As of March 2015, Laravel is regarded as one of the most popular PHP frameworks, together with Symfony2, Nette, CodeIgniter, Yii2 and other frameworks. 27
  • 28. Laravel Requirements: ▪ The Laravel framework has a few system requirements: ▪ PHP >= 5.6.4 ▪ OpenSSL PHP Extension ▪ PDO PHP Extension ▪ Mbstring PHP Extension ▪ Tokenizer PHP Extension ▪ XML PHP Extension Laravel utilizes Composer to manage its dependencies. So, before using Laravel, make sure you have Composer installed on your machine. 28
  • 29. Install Laravel ▪ First, download the Laravel installer using Composer: ▪ composer global require "laravel/installer“ ▪ laravel new blog 29