Soumettre la recherche
Mettre en ligne
Oop in php lecture 2
•
0 j'aime
•
424 vues
Mudasir Syed
Suivre
Oop in php lecture 2
Lire moins
Lire la suite
Formation
Signaler
Partager
Signaler
Partager
1 sur 6
Télécharger maintenant
Télécharger pour lire hors ligne
Recommandé
Oo abap-sap-1206973306636228-5
Oo abap-sap-1206973306636228-5
prakash185645
iOS development introduction
iOS development introduction
paramisoft
Final keyword
Final keyword
Namrata_Thakare
Abap Objects for BW
Abap Objects for BW
Luc Vanrobays
Lecture13 abap on line
Lecture13 abap on line
Milind Patil
Object oriented programming in java
Object oriented programming in java
Elizabeth alexander
Abap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorials
cesarmendez78
Features of java - javatportal
Features of java - javatportal
JavaTportal
Contenu connexe
Tendances
Beginners Guide to Object Orientation in PHP
Beginners Guide to Object Orientation in PHP
Rick Ogden
Final keyword in java
Final keyword in java
Hitesh Kumar
Jsp tag library
Jsp tag library
sandeep54552
Javascript Road Trip(es6)
Javascript Road Trip(es6)
Ahmed Assaf
Functions in sap hana
Functions in sap hana
kabilarasan R
Learn To Code: Introduction to c
Learn To Code: Introduction to c
SadhanaParameswaran
Java Chapter 04 - Writing Classes: part 2
Java Chapter 04 - Writing Classes: part 2
DanWooster1
Tendances
(7)
Beginners Guide to Object Orientation in PHP
Beginners Guide to Object Orientation in PHP
Final keyword in java
Final keyword in java
Jsp tag library
Jsp tag library
Javascript Road Trip(es6)
Javascript Road Trip(es6)
Functions in sap hana
Functions in sap hana
Learn To Code: Introduction to c
Learn To Code: Introduction to c
Java Chapter 04 - Writing Classes: part 2
Java Chapter 04 - Writing Classes: part 2
En vedette
Ajax
Ajax
Mudasir Syed
PHP mysql Installing my sql 5.1
PHP mysql Installing my sql 5.1
Mudasir Syed
PHP mysql Sql
PHP mysql Sql
Mudasir Syed
Web forms and html lecture Number 2
Web forms and html lecture Number 2
Mudasir Syed
Cookies in php lecture 2
Cookies in php lecture 2
Mudasir Syed
Web forms and html lecture Number 5
Web forms and html lecture Number 5
Mudasir Syed
Error reporting in php
Error reporting in php
Mudasir Syed
Adminstrating Through PHPMyAdmin
Adminstrating Through PHPMyAdmin
Mudasir Syed
Php Mysql
Php Mysql
Mudasir Syed
Time manipulation lecture 1
Time manipulation lecture 1
Mudasir Syed
PHP mysql Er diagram
PHP mysql Er diagram
Mudasir Syed
Cookies in php lecture 1
Cookies in php lecture 1
Mudasir Syed
PHP mysql Database normalizatin
PHP mysql Database normalizatin
Mudasir Syed
Reporting using FPDF
Reporting using FPDF
Mudasir Syed
Sql select
Sql select
Mudasir Syed
PHP mysql Mysql joins
PHP mysql Mysql joins
Mudasir Syed
Time manipulation lecture 2
Time manipulation lecture 2
Mudasir Syed
Oop in php lecture 2
Oop in php lecture 2
Mudasir Syed
Form validation server side
Form validation server side
Mudasir Syed
Form validation with built in functions
Form validation with built in functions
Mudasir Syed
En vedette
(20)
Ajax
Ajax
PHP mysql Installing my sql 5.1
PHP mysql Installing my sql 5.1
PHP mysql Sql
PHP mysql Sql
Web forms and html lecture Number 2
Web forms and html lecture Number 2
Cookies in php lecture 2
Cookies in php lecture 2
Web forms and html lecture Number 5
Web forms and html lecture Number 5
Error reporting in php
Error reporting in php
Adminstrating Through PHPMyAdmin
Adminstrating Through PHPMyAdmin
Php Mysql
Php Mysql
Time manipulation lecture 1
Time manipulation lecture 1
PHP mysql Er diagram
PHP mysql Er diagram
Cookies in php lecture 1
Cookies in php lecture 1
PHP mysql Database normalizatin
PHP mysql Database normalizatin
Reporting using FPDF
Reporting using FPDF
Sql select
Sql select
PHP mysql Mysql joins
PHP mysql Mysql joins
Time manipulation lecture 2
Time manipulation lecture 2
Oop in php lecture 2
Oop in php lecture 2
Form validation server side
Form validation server side
Form validation with built in functions
Form validation with built in functions
Similaire à Oop in php lecture 2
12.2 Abstract class and Interface.ppt
12.2 Abstract class and Interface.ppt
VISHNUSHANKARSINGH3
J2EE vs JavaEE
J2EE vs JavaEE
eanimou
JSP Directives
JSP Directives
ShahDhruv21
SMI - Introduction to Java
SMI - Introduction to Java
SMIJava
java.pptx
java.pptx
PRASHANTKULKARNI133
Java interfaces
Java interfaces
Sujit Kumar
What is Interface in Java | How to implement Multiple Inheritance Using Inter...
What is Interface in Java | How to implement Multiple Inheritance Using Inter...
Edureka!
Unit 2 Fundamentals of React -------.pptx
Unit 2 Fundamentals of React -------.pptx
krishitajariwala72
Intro to java 8
Intro to java 8
John Godoi
Understanding And Using Reflection
Understanding And Using Reflection
Ganesh Samarthyam
Zend framework: Getting to grips (ZF1)
Zend framework: Getting to grips (ZF1)
Ryan Mauger
Webinar: Zend framework Getting to grips (ZF1)
Webinar: Zend framework Getting to grips (ZF1)
Ryan Mauger
Java interfaces
Java interfaces
Elizabeth alexander
OOFeatures_revised-2.pptx
OOFeatures_revised-2.pptx
ssuser84e52e
Drupal 8 - Core and API Changes
Drupal 8 - Core and API Changes
Shabir Ahmad
The smartpath information systems java
The smartpath information systems java
The Smartpath Information Systems,Bhilai,Durg,Chhattisgarh.
Concurrency Programming in Java - 02 - Essentials of Java Part 1
Concurrency Programming in Java - 02 - Essentials of Java Part 1
Sachintha Gunasena
Creational Design Patterns
Creational Design Patterns
Jamie (Taka) Wang
Comparison of different access controls
Comparison of different access controls
Rashmi Nair
Jdbc
Jdbc
DeepikaT13
Similaire à Oop in php lecture 2
(20)
12.2 Abstract class and Interface.ppt
12.2 Abstract class and Interface.ppt
J2EE vs JavaEE
J2EE vs JavaEE
JSP Directives
JSP Directives
SMI - Introduction to Java
SMI - Introduction to Java
java.pptx
java.pptx
Java interfaces
Java interfaces
What is Interface in Java | How to implement Multiple Inheritance Using Inter...
What is Interface in Java | How to implement Multiple Inheritance Using Inter...
Unit 2 Fundamentals of React -------.pptx
Unit 2 Fundamentals of React -------.pptx
Intro to java 8
Intro to java 8
Understanding And Using Reflection
Understanding And Using Reflection
Zend framework: Getting to grips (ZF1)
Zend framework: Getting to grips (ZF1)
Webinar: Zend framework Getting to grips (ZF1)
Webinar: Zend framework Getting to grips (ZF1)
Java interfaces
Java interfaces
OOFeatures_revised-2.pptx
OOFeatures_revised-2.pptx
Drupal 8 - Core and API Changes
Drupal 8 - Core and API Changes
The smartpath information systems java
The smartpath information systems java
Concurrency Programming in Java - 02 - Essentials of Java Part 1
Concurrency Programming in Java - 02 - Essentials of Java Part 1
Creational Design Patterns
Creational Design Patterns
Comparison of different access controls
Comparison of different access controls
Jdbc
Jdbc
Plus de Mudasir Syed
Filing system in PHP
Filing system in PHP
Mudasir Syed
PHP mysql Introduction database
PHP mysql Introduction database
Mudasir Syed
PHP mysql Aggregate functions
PHP mysql Aggregate functions
Mudasir Syed
Form validation client side
Form validation client side
Mudasir Syed
Javascript lecture 4
Javascript lecture 4
Mudasir Syed
Javascript lecture 3
Javascript lecture 3
Mudasir Syed
Javascript 2
Javascript 2
Mudasir Syed
Java script lecture 1
Java script lecture 1
Mudasir Syed
Dom in javascript
Dom in javascript
Mudasir Syed
Functions in php
Functions in php
Mudasir Syed
PHP array 2
PHP array 2
Mudasir Syed
PHP array 1
PHP array 1
Mudasir Syed
Plus de Mudasir Syed
(12)
Filing system in PHP
Filing system in PHP
PHP mysql Introduction database
PHP mysql Introduction database
PHP mysql Aggregate functions
PHP mysql Aggregate functions
Form validation client side
Form validation client side
Javascript lecture 4
Javascript lecture 4
Javascript lecture 3
Javascript lecture 3
Javascript 2
Javascript 2
Java script lecture 1
Java script lecture 1
Dom in javascript
Dom in javascript
Functions in php
Functions in php
PHP array 2
PHP array 2
PHP array 1
PHP array 1
Dernier
How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17
Celine George
Finals of Kant get Marx 2.0 : a general politics quiz
Finals of Kant get Marx 2.0 : a general politics quiz
Conquiztadors- the Quiz Society of Sri Venkateswara College
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptx
raviapr7
What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?
TechSoup
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.
EnglishCEIPdeSigeiro
The Singapore Teaching Practice document
The Singapore Teaching Practice document
Xsasf Sfdfasd
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
Tanmoy Mishra
5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...
CaraSkikne1
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
Yu Kanazawa / Osaka University
How to Solve Singleton Error in the Odoo 17
How to Solve Singleton Error in the Odoo 17
Celine George
Practical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptx
Katherine Villaluna
Philosophy of Education and Educational Philosophy
Philosophy of Education and Educational Philosophy
Shuvankar Madhu
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
TechSoup
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17
Celine George
How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17
Celine George
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
iammrhaywood
Human-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming Classes
Mohammad Hassany
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptx
Dr. Asif Anas
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
raviapr7
Benefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive Education
MJDuyan
Dernier
(20)
How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17
Finals of Kant get Marx 2.0 : a general politics quiz
Finals of Kant get Marx 2.0 : a general politics quiz
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptx
What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.
The Singapore Teaching Practice document
The Singapore Teaching Practice document
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
How to Solve Singleton Error in the Odoo 17
How to Solve Singleton Error in the Odoo 17
Practical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptx
Philosophy of Education and Educational Philosophy
Philosophy of Education and Educational Philosophy
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
Human-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming Classes
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Benefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive Education
Oop in php lecture 2
1.
© Copyright 2012
Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org Interface • Interface is an empty class which contains only the declaration of methods. • So any class which implements this interface must contain the declared functions in it. • Interface is nothing but a strict ruling, which helps to extend any class and strictly implement all methods defined in interface. • A class can use any interface by using the implements keyword. • In interface you can only declare methods, but you cannot write their body. • That means the body of all methods must remain blank. • One of the reasons is it implies strict rules while creating a class.
2.
© Copyright 2012
Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org Interface Cont… <? //interface.dbdriver.php interface DBDriver { public function connect(); public function execute($sql); } ?> • Did you notice that the functions are empty in an interface? Now let's create our MySQLDriver class, which implements this interface. <? //class.mysqldriver.php include("interface.dbdriver.php"); class MySQLDriver implements DBDriver { } ?> • Now if you execute the code above, it will Fatal error, since we have not implemented all methods in child class.
3.
© Copyright 2012
Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org Interface Cont… <? include("interface.dbdriver.php"); class MySQLDriver implements DBDriver { public function connect() { //connect to database } public function execute($query) { //execute the query and output result } } ?> • Let's rewrite our MySQLDriver class as follows.
4.
© Copyright 2012
Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org Abstract Classes • An abstract class is almost the same as interface. • Except that now the methods can contain body. • An abstract class must also be "extended", not "implemented". • If the extended classes have some methods with common functionalities, then you can define those functions in an abstract class. <? //abstract.reportgenerator.php abstract class ReportGenerator { public function generateReport($resultArray) { //write code to process the multidimensional result array and //generate HTML Report } } ?>
5.
© Copyright 2012
Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org Abstract Classes Cont… • Please note that we can use the abstract class and implement an interface. • Similar to declaring a class as abstract, you can also declare any method as abstract. • When a method is declared as abstract, it means that the subclass must override that method. <? include("interface.dbdriver.php"); include("abstract.reportgenerator.php"); class MySQLDriver extends ReportGenerator implements DBDriver { public function connect() { //connect to database } public function execute($query) { //execute the query and output result } / / you need not declare or write the generateReport method here you need not declare or write the generateReport method here //again as it is extended from the abstract class directly." } ?>
6.
© Copyright 2012
Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org Abstract Classes Cont… • Please note that we can use the abstract class and implement an interface. • Similar to declaring a class as abstract, you can also declare any method as abstract. • When a method is declared as abstract, it means that the subclass must override that method. <? include("interface.dbdriver.php"); include("abstract.reportgenerator.php"); class MySQLDriver extends ReportGenerator implements DBDriver { public function connect() { //connect to database } public function execute($query) { //execute the query and output result } / / you need not declare or write the generateReport method here you need not declare or write the generateReport method here //again as it is extended from the abstract class directly." } ?>
Télécharger maintenant