SlideShare a Scribd company logo
Object-Oriented
Programming
(with Laravel)
By: Shahrzad Peyman
Session 3
April-2017
shahrzad.peymaan@gmail.com
1
2
Today’s Presentation
• Final Methods
• Interface
• Abstract
• Template Engine
• Blade
• Template Inheritance
• Blade Syntax
Final Methods
Most of the time, allowing your classes to be extended
using inheritance is a good thing. It's part of what
makes object-oriented programming so powerful.
Occasionally, though, overriding certain methods of a
class can cause things to break easily, create security
issues, or make the resulting code overly complex.
When you wish to prevent a subclass from overriding
a superclass method, you can use the final keyword.
3
4
Final Methods
5
Interface
An interface is an outline of what a particular
object can do. You will often hear that an
interface is a contract. This is true in as much
as an interface defines the public methods that
a class must implement.
Object interfaces allow you to create code
which specifies which methods a class must
implement, without having to define how these
methods are handled.
Interface
6
Abstract
7
An abstract class is a special type of class that can't
be instantiated — in other words, you can't create
objects from it. Instead, you create child classes
from the abstract class, and create objects from
those child classes instead.
An abstract class is designed to be used as a
template for creating classes.
An abstract class will have abstract methods which
are defined by the abstract keyword, these methods
are like the methods defined in the interface classes.
8
Abstract
Interface vs Abstract
Interface Abstract
The Code
• abstract methods
• constants
• abstract methods
• constants
• concrete methods
• concrete variables
Access Modifiers • public
• public
• private
• protected
Number of Parents
Class can impelement
more than one interface
Class can inherit only
from one abstract class
9
What is template engine?
Template Engine, combines web templates to form
finished web pages, possibly using some data
source to customize the pages or present a large
amount of content on similar-looking pages.
As you know, the controller is responsible for
handling each request that comes into a Laravel
application. When a controller needs to generate
HTML, CSS or any other content, it hands the work
off to the templating engine.
10
Template Engine
11
Template
12
A template is simply a text file that can generate any
text-based format (HTML, XML, CSV, LaTeX ...). The
most familiar type of template is a PHP template - a text
file parsed by PHP that contains a mix of text and PHP
code.
Blade
Blade is the simple, yet powerful templating engine
provided with Laravel.
Unlike other popular PHP templating engines, Blade
does not restrict you from using plain PHP code in your
views. In fact, all Blade views are compiled into plain
PHP code and cached until they are modified, meaning
Blade adds essentially zero overhead to your
application.
Blade
Blade view files use the .blade.php file extension and
are typically stored in the resources/views directory.
Every template name also has two extensions that
specify the format and engine for that template.
Views contain the HTML served by your application
and separate your controller / application logic from
your presentation logic.
Template Inheritance
Defining a Layout:
Two of the primary benefits
of using Blade are template
inheritance and sections.
Template Inheritance
16
Extending a Layout:
When defining a child view,
use the Blade @extends
directive to specify which
layout the child view should
"inherit".
Routes & Blade Views
Blade views may be returned from routes using
the global view helper:
17
Components & Slots
18
Components and slots provide similar benefits to
sections and layouts; however, some may find the
mental model of components and slots easier to
understand.
Components & Slots
19
Displaying Data
You may display data passed to your Blade views by
wrapping the variable in curly braces.
20
Displaying Data
When passing information in this manner, $data should be an
array with key/value pairs. Inside your view, you can then access
each value using its corresponding key.
You can do:
21
22
Displaying Data
Of course, you are not limited to displaying the contents of
the variables passed to the view. You may also echo the
results of any PHP function. In fact, you can put any PHP
code you wish inside of a Blade echo statement:
If you do not want your data to be escaped, you may use the
following syntax:
23
Sharing Data with All Views
Occasionally, you may
need to share a piece of
data with all views that
are rendered by your
application.
24
Blade & JavaScript
Framework
Since many JavaScript frameworks also use "curly"
braces to indicate a given expression should be
displayed in the browser, you may use the @ symbol to
inform the Blade rendering engine an expression
should remain untouched. For example:
25
Blade & JavaScript
Framework
If you are displaying JavaScript variables in a large
portion of your template, you may wrap the HTML in the
@verbatim directive so that you do not have to prefix
each Blade echo statement with an @ symbol:
If Statements
26
Loops
27
28
Loops
29
Loops
30
Comments
Blade also allows you to define comments in your
views. However, unlike HTML comments, Blade
comments are not included in the HTML returned by
your application:
31
Including Sub-Views
Blade’s @include directive allows you to
include a Blade view from within another view.
All variables that are available to the parent
view will be made available to the included
view:
32
Rendering Views For Collections

More Related Content

What's hot (20)

ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP Fundamentals
Ido Flatow
 
Spring Boot Tutorial
Spring Boot TutorialSpring Boot Tutorial
Spring Boot Tutorial
Naphachara Rattanawilai
 
Burp suite
Burp suiteBurp suite
Burp suite
hamdi_sevben
 
Laravel
LaravelLaravel
Laravel
tanveerkhan62
 
Laravel overview
Laravel overviewLaravel overview
Laravel overview
Obinna Akunne
 
Lecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptxLecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptx
SaziaRahman
 
MongoDB Aggregation Framework
MongoDB Aggregation FrameworkMongoDB Aggregation Framework
MongoDB Aggregation Framework
Caserta
 
Deep dive into SoapUI
Deep dive into SoapUIDeep dive into SoapUI
Deep dive into SoapUI
Andrey Oleynik
 
Introduction to laravel framework
Introduction to laravel frameworkIntroduction to laravel framework
Introduction to laravel framework
Ahmad Fatoni
 
Laravel presentation
Laravel presentationLaravel presentation
Laravel presentation
Toufiq Mahmud
 
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
 
API Design- Best Practices
API Design-   Best PracticesAPI Design-   Best Practices
API Design- Best Practices
Prakash Bhandari
 
Web development presentation
Web development presentationWeb development presentation
Web development presentation
Vaishnavi8950
 
Angular overview
Angular overviewAngular overview
Angular overview
Thanvilahari
 
Laravel
LaravelLaravel
Laravel
Dyuti Islam
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
Mayank Panchal
 
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!
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
Prem Sanil
 
laravel.pptx
laravel.pptxlaravel.pptx
laravel.pptx
asif290119
 
Angular js PPT
Angular js PPTAngular js PPT
Angular js PPT
Imtiyaz Ahmad Khan
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP Fundamentals
Ido Flatow
 
Lecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptxLecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptx
SaziaRahman
 
MongoDB Aggregation Framework
MongoDB Aggregation FrameworkMongoDB Aggregation Framework
MongoDB Aggregation Framework
Caserta
 
Introduction to laravel framework
Introduction to laravel frameworkIntroduction to laravel framework
Introduction to laravel framework
Ahmad Fatoni
 
Laravel presentation
Laravel presentationLaravel presentation
Laravel presentation
Toufiq Mahmud
 
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
 
Web development presentation
Web development presentationWeb development presentation
Web development presentation
Vaishnavi8950
 
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!
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
Prem Sanil
 

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

Web Programming - 7 Blading Template
Web Programming - 7 Blading TemplateWeb Programming - 7 Blading Template
Web Programming - 7 Blading Template
AndiNurkholis1
 
Lecture15_LaravelGetStarted_SPring2023.pdf
Lecture15_LaravelGetStarted_SPring2023.pdfLecture15_LaravelGetStarted_SPring2023.pdf
Lecture15_LaravelGetStarted_SPring2023.pdf
ShaimaaMohamedGalal
 
Laravel
LaravelLaravel
Laravel
SitaPrajapati
 
Laravel Meetup
Laravel MeetupLaravel Meetup
Laravel Meetup
Whisnu Sucitanuary
 
Laravel 5
Laravel 5Laravel 5
Laravel 5
Sudip Simkhada
 
Laravel Framework for web development.pptx
Laravel Framework for web development.pptxLaravel Framework for web development.pptx
Laravel Framework for web development.pptx
Eric Walter
 
Laravel 101
Laravel 101Laravel 101
Laravel 101
Commit University
 
Introduction_to_Laravel_Background DOCUMENTATION.pptx
Introduction_to_Laravel_Background DOCUMENTATION.pptxIntroduction_to_Laravel_Background DOCUMENTATION.pptx
Introduction_to_Laravel_Background DOCUMENTATION.pptx
michaelcagampang4
 
Introduction_to_Laravel_Simple DUCUMENTATION.pptx
Introduction_to_Laravel_Simple DUCUMENTATION.pptxIntroduction_to_Laravel_Simple DUCUMENTATION.pptx
Introduction_to_Laravel_Simple DUCUMENTATION.pptx
michaelcagampang4
 
Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)
Viral Solani
 
Why Laravel?
Why Laravel?Why Laravel?
Why Laravel?
Jonathan Goode
 
Laravel framework - An overview and usability for web development
Laravel framework - An overview and usability for web developmentLaravel framework - An overview and usability for web development
Laravel framework - An overview and usability for web development
ifour_bhavesh
 
What-is-Laravel and introduciton to Laravel
What-is-Laravel and introduciton to LaravelWhat-is-Laravel and introduciton to Laravel
What-is-Laravel and introduciton to Laravel
PraveenHegde20
 
Lecture 4_Laravel Controller and Data Pass-Route.pptx
Lecture 4_Laravel Controller and Data Pass-Route.pptxLecture 4_Laravel Controller and Data Pass-Route.pptx
Lecture 4_Laravel Controller and Data Pass-Route.pptx
SaziaRahman
 
Laravel 5
Laravel 5Laravel 5
Laravel 5
Brian Feaver
 
Laravel session 1
Laravel  session 1Laravel  session 1
Laravel session 1
Ashish Kumar
 
Key Features of Laravel for Developers - Eminence
Key Features of Laravel for Developers - EminenceKey Features of Laravel for Developers - Eminence
Key Features of Laravel for Developers - Eminence
Eminence Technology
 
Laravel Webcon 2015
Laravel Webcon 2015Laravel Webcon 2015
Laravel Webcon 2015
Tim Bracken
 
Unleashing the Power of Laravel A Journey to Modern Web Development | CETPA I...
Unleashing the Power of Laravel A Journey to Modern Web Development | CETPA I...Unleashing the Power of Laravel A Journey to Modern Web Development | CETPA I...
Unleashing the Power of Laravel A Journey to Modern Web Development | CETPA I...
Cetpa Infotech
 
Laravel Introduction
Laravel IntroductionLaravel Introduction
Laravel Introduction
Ahmad Shah Hafizan Hamidin
 
Web Programming - 7 Blading Template
Web Programming - 7 Blading TemplateWeb Programming - 7 Blading Template
Web Programming - 7 Blading Template
AndiNurkholis1
 
Lecture15_LaravelGetStarted_SPring2023.pdf
Lecture15_LaravelGetStarted_SPring2023.pdfLecture15_LaravelGetStarted_SPring2023.pdf
Lecture15_LaravelGetStarted_SPring2023.pdf
ShaimaaMohamedGalal
 
Laravel Framework for web development.pptx
Laravel Framework for web development.pptxLaravel Framework for web development.pptx
Laravel Framework for web development.pptx
Eric Walter
 
Introduction_to_Laravel_Background DOCUMENTATION.pptx
Introduction_to_Laravel_Background DOCUMENTATION.pptxIntroduction_to_Laravel_Background DOCUMENTATION.pptx
Introduction_to_Laravel_Background DOCUMENTATION.pptx
michaelcagampang4
 
Introduction_to_Laravel_Simple DUCUMENTATION.pptx
Introduction_to_Laravel_Simple DUCUMENTATION.pptxIntroduction_to_Laravel_Simple DUCUMENTATION.pptx
Introduction_to_Laravel_Simple DUCUMENTATION.pptx
michaelcagampang4
 
Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)
Viral Solani
 
Laravel framework - An overview and usability for web development
Laravel framework - An overview and usability for web developmentLaravel framework - An overview and usability for web development
Laravel framework - An overview and usability for web development
ifour_bhavesh
 
What-is-Laravel and introduciton to Laravel
What-is-Laravel and introduciton to LaravelWhat-is-Laravel and introduciton to Laravel
What-is-Laravel and introduciton to Laravel
PraveenHegde20
 
Lecture 4_Laravel Controller and Data Pass-Route.pptx
Lecture 4_Laravel Controller and Data Pass-Route.pptxLecture 4_Laravel Controller and Data Pass-Route.pptx
Lecture 4_Laravel Controller and Data Pass-Route.pptx
SaziaRahman
 
Key Features of Laravel for Developers - Eminence
Key Features of Laravel for Developers - EminenceKey Features of Laravel for Developers - Eminence
Key Features of Laravel for Developers - Eminence
Eminence Technology
 
Laravel Webcon 2015
Laravel Webcon 2015Laravel Webcon 2015
Laravel Webcon 2015
Tim Bracken
 
Unleashing the Power of Laravel A Journey to Modern Web Development | CETPA I...
Unleashing the Power of Laravel A Journey to Modern Web Development | CETPA I...Unleashing the Power of Laravel A Journey to Modern Web Development | CETPA I...
Unleashing the Power of Laravel A Journey to Modern Web Development | CETPA I...
Cetpa Infotech
 
Ad

More from Shahrzad Peyman (12)

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
 
Object Oriented Programming with Laravel - Session 1
Object Oriented Programming with Laravel - Session 1Object Oriented Programming with Laravel - Session 1
Object Oriented Programming with Laravel - Session 1
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
 
Object Oriented Programming with Laravel - Session 1
Object Oriented Programming with Laravel - Session 1Object Oriented Programming with Laravel - Session 1
Object Oriented Programming with Laravel - Session 1
Shahrzad Peyman
 
Ad

Recently uploaded (20)

IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptxIMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
usmanch7829
 
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps CyclesFrom Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
Marjukka Niinioja
 
Key AI Technologies Used by Indian Artificial Intelligence Companies
Key AI Technologies Used by Indian Artificial Intelligence CompaniesKey AI Technologies Used by Indian Artificial Intelligence Companies
Key AI Technologies Used by Indian Artificial Intelligence Companies
Mypcot Infotech
 
Maximizing Business Value with AWS Consulting Services.pdf
Maximizing Business Value with AWS Consulting Services.pdfMaximizing Business Value with AWS Consulting Services.pdf
Maximizing Business Value with AWS Consulting Services.pdf
Elena Mia
 
Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3
Gaurav Sharma
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
Essentials of Resource Planning in a Downturn
Essentials of Resource Planning in a DownturnEssentials of Resource Planning in a Downturn
Essentials of Resource Planning in a Downturn
OnePlan Solutions
 
COBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM CertificateCOBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM Certificate
VICTOR MAESTRE RAMIREZ
 
Top 5 Task Management Software to Boost Productivity in 2025
Top 5 Task Management Software to Boost Productivity in 2025Top 5 Task Management Software to Boost Productivity in 2025
Top 5 Task Management Software to Boost Productivity in 2025
Orangescrum
 
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
Insurance Tech Services
 
Integrating Survey123 and R&H Data Using FME
Integrating Survey123 and R&H Data Using FMEIntegrating Survey123 and R&H Data Using FME
Integrating Survey123 and R&H Data Using FME
Safe Software
 
Software Engineering Process, Notation & Tools Introduction - Part 4
Software Engineering Process, Notation & Tools Introduction - Part 4Software Engineering Process, Notation & Tools Introduction - Part 4
Software Engineering Process, Notation & Tools Introduction - Part 4
Gaurav Sharma
 
dp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdfdp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdf
pravkumarbiz
 
Marketo & Dynamics can be Most Excellent to Each Other – The Sequel
Marketo & Dynamics can be Most Excellent to Each Other – The SequelMarketo & Dynamics can be Most Excellent to Each Other – The Sequel
Marketo & Dynamics can be Most Excellent to Each Other – The Sequel
BradBedford3
 
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink TemplateeeeeeeeeeeeeeeeeeeeeeeeeeNeuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
alexandernoetzold
 
Migrating to Azure Cosmos DB the Right Way
Migrating to Azure Cosmos DB the Right WayMigrating to Azure Cosmos DB the Right Way
Migrating to Azure Cosmos DB the Right Way
Alexander (Alex) Komyagin
 
AI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA TechnologiesAI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA Technologies
SandeepKS52
 
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Alluxio, Inc.
 
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdfTop 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Trackobit
 
wAIred_RabobankIgniteSession_12062025.pptx
wAIred_RabobankIgniteSession_12062025.pptxwAIred_RabobankIgniteSession_12062025.pptx
wAIred_RabobankIgniteSession_12062025.pptx
SimonedeGijt
 
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptxIMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
usmanch7829
 
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps CyclesFrom Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
Marjukka Niinioja
 
Key AI Technologies Used by Indian Artificial Intelligence Companies
Key AI Technologies Used by Indian Artificial Intelligence CompaniesKey AI Technologies Used by Indian Artificial Intelligence Companies
Key AI Technologies Used by Indian Artificial Intelligence Companies
Mypcot Infotech
 
Maximizing Business Value with AWS Consulting Services.pdf
Maximizing Business Value with AWS Consulting Services.pdfMaximizing Business Value with AWS Consulting Services.pdf
Maximizing Business Value with AWS Consulting Services.pdf
Elena Mia
 
Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3
Gaurav Sharma
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
Essentials of Resource Planning in a Downturn
Essentials of Resource Planning in a DownturnEssentials of Resource Planning in a Downturn
Essentials of Resource Planning in a Downturn
OnePlan Solutions
 
COBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM CertificateCOBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM Certificate
VICTOR MAESTRE RAMIREZ
 
Top 5 Task Management Software to Boost Productivity in 2025
Top 5 Task Management Software to Boost Productivity in 2025Top 5 Task Management Software to Boost Productivity in 2025
Top 5 Task Management Software to Boost Productivity in 2025
Orangescrum
 
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
Insurance Tech Services
 
Integrating Survey123 and R&H Data Using FME
Integrating Survey123 and R&H Data Using FMEIntegrating Survey123 and R&H Data Using FME
Integrating Survey123 and R&H Data Using FME
Safe Software
 
Software Engineering Process, Notation & Tools Introduction - Part 4
Software Engineering Process, Notation & Tools Introduction - Part 4Software Engineering Process, Notation & Tools Introduction - Part 4
Software Engineering Process, Notation & Tools Introduction - Part 4
Gaurav Sharma
 
dp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdfdp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdf
pravkumarbiz
 
Marketo & Dynamics can be Most Excellent to Each Other – The Sequel
Marketo & Dynamics can be Most Excellent to Each Other – The SequelMarketo & Dynamics can be Most Excellent to Each Other – The Sequel
Marketo & Dynamics can be Most Excellent to Each Other – The Sequel
BradBedford3
 
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink TemplateeeeeeeeeeeeeeeeeeeeeeeeeeNeuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
alexandernoetzold
 
AI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA TechnologiesAI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA Technologies
SandeepKS52
 
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Alluxio, Inc.
 
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdfTop 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Trackobit
 
wAIred_RabobankIgniteSession_12062025.pptx
wAIred_RabobankIgniteSession_12062025.pptxwAIred_RabobankIgniteSession_12062025.pptx
wAIred_RabobankIgniteSession_12062025.pptx
SimonedeGijt
 

Object Oriented Programming with Laravel - Session 3

  • 2. 2 Today’s Presentation • Final Methods • Interface • Abstract • Template Engine • Blade • Template Inheritance • Blade Syntax
  • 3. Final Methods Most of the time, allowing your classes to be extended using inheritance is a good thing. It's part of what makes object-oriented programming so powerful. Occasionally, though, overriding certain methods of a class can cause things to break easily, create security issues, or make the resulting code overly complex. When you wish to prevent a subclass from overriding a superclass method, you can use the final keyword. 3
  • 5. 5 Interface An interface is an outline of what a particular object can do. You will often hear that an interface is a contract. This is true in as much as an interface defines the public methods that a class must implement. Object interfaces allow you to create code which specifies which methods a class must implement, without having to define how these methods are handled.
  • 7. Abstract 7 An abstract class is a special type of class that can't be instantiated — in other words, you can't create objects from it. Instead, you create child classes from the abstract class, and create objects from those child classes instead. An abstract class is designed to be used as a template for creating classes. An abstract class will have abstract methods which are defined by the abstract keyword, these methods are like the methods defined in the interface classes.
  • 9. Interface vs Abstract Interface Abstract The Code • abstract methods • constants • abstract methods • constants • concrete methods • concrete variables Access Modifiers • public • public • private • protected Number of Parents Class can impelement more than one interface Class can inherit only from one abstract class 9
  • 10. What is template engine? Template Engine, combines web templates to form finished web pages, possibly using some data source to customize the pages or present a large amount of content on similar-looking pages. As you know, the controller is responsible for handling each request that comes into a Laravel application. When a controller needs to generate HTML, CSS or any other content, it hands the work off to the templating engine. 10
  • 12. Template 12 A template is simply a text file that can generate any text-based format (HTML, XML, CSV, LaTeX ...). The most familiar type of template is a PHP template - a text file parsed by PHP that contains a mix of text and PHP code.
  • 13. Blade Blade is the simple, yet powerful templating engine provided with Laravel. Unlike other popular PHP templating engines, Blade does not restrict you from using plain PHP code in your views. In fact, all Blade views are compiled into plain PHP code and cached until they are modified, meaning Blade adds essentially zero overhead to your application.
  • 14. Blade Blade view files use the .blade.php file extension and are typically stored in the resources/views directory. Every template name also has two extensions that specify the format and engine for that template. Views contain the HTML served by your application and separate your controller / application logic from your presentation logic.
  • 15. Template Inheritance Defining a Layout: Two of the primary benefits of using Blade are template inheritance and sections.
  • 16. Template Inheritance 16 Extending a Layout: When defining a child view, use the Blade @extends directive to specify which layout the child view should "inherit".
  • 17. Routes & Blade Views Blade views may be returned from routes using the global view helper: 17
  • 18. Components & Slots 18 Components and slots provide similar benefits to sections and layouts; however, some may find the mental model of components and slots easier to understand.
  • 20. Displaying Data You may display data passed to your Blade views by wrapping the variable in curly braces. 20
  • 21. Displaying Data When passing information in this manner, $data should be an array with key/value pairs. Inside your view, you can then access each value using its corresponding key. You can do: 21
  • 22. 22 Displaying Data Of course, you are not limited to displaying the contents of the variables passed to the view. You may also echo the results of any PHP function. In fact, you can put any PHP code you wish inside of a Blade echo statement: If you do not want your data to be escaped, you may use the following syntax:
  • 23. 23 Sharing Data with All Views Occasionally, you may need to share a piece of data with all views that are rendered by your application.
  • 24. 24 Blade & JavaScript Framework Since many JavaScript frameworks also use "curly" braces to indicate a given expression should be displayed in the browser, you may use the @ symbol to inform the Blade rendering engine an expression should remain untouched. For example:
  • 25. 25 Blade & JavaScript Framework If you are displaying JavaScript variables in a large portion of your template, you may wrap the HTML in the @verbatim directive so that you do not have to prefix each Blade echo statement with an @ symbol:
  • 30. 30 Comments Blade also allows you to define comments in your views. However, unlike HTML comments, Blade comments are not included in the HTML returned by your application:
  • 31. 31 Including Sub-Views Blade’s @include directive allows you to include a Blade view from within another view. All variables that are available to the parent view will be made available to the included view:
  • 32. 32 Rendering Views For Collections