Why PHP?
What does PHP stand for?  Personal Homepage  PHP: Hypertext Preprocessor (recursive acronym)  Created by Rasmus Lerdorf (1994)
It’s FREE!!  PHP is open-source
Platform Independent  Can be deployed/installed in different OS
Great Documentation  php.net  Functions are well explained + informative examples
Large and Active Community  stackoverflow  php.net  github  Etc...
Easy to learn  Simple syntax  Well documented  Lots of tutorials everywhere  Lots of premade libraries
WHY PHP  It’s Free  Platform Independent  Great Documentation  Large and Active Community  Easy to learn
OBJECT ORIENTED PROGRAMMING
Object Oriented Programming  A programming concept that treats functions and data as objects.  A programming methodology based on objects, instead of functions and procedures.
“I explain that procedural program is built around the "verbs" of the system, the things you want the system to do, whereas object-oriented programming is build about the "nouns," the things in the system, and what they are capable of.”
Object and Class
CLASS  is a "template"/"blueprint" that is used to create objects  usually represents a noun, such as person, place or thing.
CLASS class PointGuard { }
OBJECT  In real world object is a material thing that can be seen and touched.  In OOP, object is a self-contained entity that consist of both data and procedures.  An instance of a class
Give examples of real life class and object.
INSTANCE
INSTANCE  layman's term - a case or occurrence of anything  a single copy of an object, there might be one or several objects, but an instance is a specific copy, to which you can have a reference
$instance = new PointGuard();
INHERITANCE
INHERITANCE  biology - the genetic characters transmitted from parents to offspring  OOP - provides reusability of codes. We can add additional codes to an existing class without modifying it.  can be defined as the process of one object acquires the properties of another by making subclasses (parent-child relationship)
INHERITANCE <?php class BasketballPosition { // some methods and properties } class PointGuard extends BasketballPosition { // some methods and properties }
Give examples of inheritance.
Class Properties and Methods  Height  Weight  Pass  Dribble  Shoot  Rebound  Block
Class Properties  also know as data members and is used to hold data of a class.  The data that it holds are specific to the nature of the class in which it has been defined.
Class Properties class PointGuard { public $name; public $ball_handling_level; }
Class Methods  functions that are associated with the class  functions that can be involve in the class property processing
Class Methods class PointGuard { public $name; public $ball_handling_level; public function createPlay() { // some processing here } }
Encapsulation
Encapsulation  facilitates the bundling of data with the methods (or other functions) operating on that data.  restricting access to some of the object’s components.  used to hide the values or state of a structured data object inside a class, preventing unauthorized parties' direct access to them.
Encapsulation Example : Courting a girl
Encapsulation  Access modifiers/Visibility private  property and method can be accessed only inside the class itself and can't be accessed anywhere else  protected  property and method can be accessed only inside the class itself and inside child classes.  public  allows the property/method to be accessed from anywhere of code 
Private class Love { private $hearbeat_per_second = 100; public function getHeartBeatPerSec() { return $this->heartbeat_per_second; } } class Valentines extends Love { public function getHeartBeatPerSecWhenNear() { return $this->heartbeat_per_second * 2; // will produce an error } } $love = new Love(); echo $love->getHeartBeatPerSec(); // will output 100 echo $love->heartbeat_per_second; // will produce an error
Protected class Love { protected $hearbeat_per_second = 100; public function getHeartBeatPerSec() { return $this->heartbeat_per_second; } } class Valentines extends Love { public function getHeartBeatPerSecWhenNear() { return $this->heartbeat_per_second * 2; // will return 200 } } $love = new Love(); echo $love->getHeartBeatPerSec(); // will output 100 echo $love->heartbeat_per_second; // will produce an error
Public class Love { public $hearbeat_per_second = 100; public function getHeartBeatPerSec() { return $this->heartbeat_per_second; } } class Valentines extends Love { public function getHeartBeatPerSecWhenNear() { return $this->heartbeat_per_second * 2; // will return 200 } } $love = new Love(); echo $love->getHeartBeatPerSec(); // will output 100 echo $love->heartbeat_per_second; // will output 100
Choosing the Right Visibility START Accessed externally? Y public N Deny to children? N protected Y private
PHP OOP  Object and Class  Instance  Inheritance  Class Properties and Methods  Encapsulation
Introduction to Git and Github
Git whhaaat???  Is a source/version control management software.  Is a software that allows you to track the changes that you make to individual files.
Github eeeeee??  is a web-based hosting service for software development projects that use the Git revision control system  “social coding”
Why u no use git and github??
Why u no use git and github??  Git can track your changes to your projects.  You can go back to a certain change you made that you want to recover.
Why u no use git and github??
Why u no use git and github??  Github lets you collaborate with other developers or your project teammates by adding comments or suggestions on commits.  You can also contribute to public/open source projects. (eg. Facebook SDK, Codeigniter, PHP, etc...)  Share your codes to public and get feedback from large community of developers.
Why u no use git and github??
Why u no use git and github??
Commands Overview  git init Initializes a git repository. git status  Check your changes made (untracked files, modified files, staged files) git commit  Save your changes into one commit history. git push  Push your changes in the remote repository. git pull  Pull changes from remote repository and apply it to your local repository. git fetch  Fetch changes from remote repository but changes will not apply to your local repository      
Git and Github  Git and github can be effectively used in project collaborations.  Can improve a developer’s coding.  Can avoid overriding or duplicating codes  Not just a developer tool
“Whenever you are asked if you can do a job, tell'em, Certainly, I can! Then get busy and find out how to do it.” - Theodore Roosevelt
Intro to OOP PHP and Github

Intro to OOP PHP and Github

  • 1.
  • 2.
    What does PHPstand for?  Personal Homepage  PHP: Hypertext Preprocessor (recursive acronym)  Created by Rasmus Lerdorf (1994)
  • 3.
    It’s FREE!!  PHPis open-source
  • 4.
    Platform Independent  Canbe deployed/installed in different OS
  • 5.
    Great Documentation  php.net Functions are well explained + informative examples
  • 6.
    Large and ActiveCommunity  stackoverflow  php.net  github  Etc...
  • 7.
    Easy to learn Simple syntax  Well documented  Lots of tutorials everywhere  Lots of premade libraries
  • 8.
    WHY PHP  It’sFree  Platform Independent  Great Documentation  Large and Active Community  Easy to learn
  • 9.
  • 10.
    Object Oriented Programming A programming concept that treats functions and data as objects.  A programming methodology based on objects, instead of functions and procedures.
  • 11.
    “I explain thatprocedural program is built around the "verbs" of the system, the things you want the system to do, whereas object-oriented programming is build about the "nouns," the things in the system, and what they are capable of.”
  • 12.
  • 13.
    CLASS  is a"template"/"blueprint" that is used to create objects  usually represents a noun, such as person, place or thing.
  • 14.
  • 15.
    OBJECT  In realworld object is a material thing that can be seen and touched.  In OOP, object is a self-contained entity that consist of both data and procedures.  An instance of a class
  • 16.
    Give examples ofreal life class and object.
  • 17.
  • 18.
    INSTANCE  layman's term- a case or occurrence of anything  a single copy of an object, there might be one or several objects, but an instance is a specific copy, to which you can have a reference
  • 19.
    $instance = newPointGuard();
  • 20.
  • 21.
    INHERITANCE  biology -the genetic characters transmitted from parents to offspring  OOP - provides reusability of codes. We can add additional codes to an existing class without modifying it.  can be defined as the process of one object acquires the properties of another by making subclasses (parent-child relationship)
  • 22.
    INHERITANCE <?php class BasketballPosition { // somemethods and properties } class PointGuard extends BasketballPosition { // some methods and properties }
  • 23.
    Give examples ofinheritance.
  • 24.
    Class Properties andMethods  Height  Weight  Pass  Dribble  Shoot  Rebound  Block
  • 25.
    Class Properties  alsoknow as data members and is used to hold data of a class.  The data that it holds are specific to the nature of the class in which it has been defined.
  • 26.
    Class Properties class PointGuard { public$name; public $ball_handling_level; }
  • 27.
    Class Methods  functionsthat are associated with the class  functions that can be involve in the class property processing
  • 28.
    Class Methods class PointGuard { public$name; public $ball_handling_level; public function createPlay() { // some processing here } }
  • 29.
  • 30.
    Encapsulation  facilitates thebundling of data with the methods (or other functions) operating on that data.  restricting access to some of the object’s components.  used to hide the values or state of a structured data object inside a class, preventing unauthorized parties' direct access to them.
  • 31.
  • 32.
    Encapsulation  Access modifiers/Visibility private property and method can be accessed only inside the class itself and can't be accessed anywhere else  protected  property and method can be accessed only inside the class itself and inside child classes.  public  allows the property/method to be accessed from anywhere of code 
  • 33.
    Private class Love { private $hearbeat_per_second= 100; public function getHeartBeatPerSec() { return $this->heartbeat_per_second; } } class Valentines extends Love { public function getHeartBeatPerSecWhenNear() { return $this->heartbeat_per_second * 2; // will produce an error } } $love = new Love(); echo $love->getHeartBeatPerSec(); // will output 100 echo $love->heartbeat_per_second; // will produce an error
  • 34.
    Protected class Love { protected $hearbeat_per_second= 100; public function getHeartBeatPerSec() { return $this->heartbeat_per_second; } } class Valentines extends Love { public function getHeartBeatPerSecWhenNear() { return $this->heartbeat_per_second * 2; // will return 200 } } $love = new Love(); echo $love->getHeartBeatPerSec(); // will output 100 echo $love->heartbeat_per_second; // will produce an error
  • 35.
    Public class Love { public $hearbeat_per_second= 100; public function getHeartBeatPerSec() { return $this->heartbeat_per_second; } } class Valentines extends Love { public function getHeartBeatPerSecWhenNear() { return $this->heartbeat_per_second * 2; // will return 200 } } $love = new Love(); echo $love->getHeartBeatPerSec(); // will output 100 echo $love->heartbeat_per_second; // will output 100
  • 36.
    Choosing the RightVisibility START Accessed externally? Y public N Deny to children? N protected Y private
  • 37.
    PHP OOP  Objectand Class  Instance  Inheritance  Class Properties and Methods  Encapsulation
  • 38.
  • 39.
    Git whhaaat???  Isa source/version control management software.  Is a software that allows you to track the changes that you make to individual files.
  • 40.
    Github eeeeee??  isa web-based hosting service for software development projects that use the Git revision control system  “social coding”
  • 41.
    Why u nouse git and github??
  • 42.
    Why u nouse git and github??  Git can track your changes to your projects.  You can go back to a certain change you made that you want to recover.
  • 43.
    Why u nouse git and github??
  • 44.
    Why u nouse git and github??  Github lets you collaborate with other developers or your project teammates by adding comments or suggestions on commits.  You can also contribute to public/open source projects. (eg. Facebook SDK, Codeigniter, PHP, etc...)  Share your codes to public and get feedback from large community of developers.
  • 45.
    Why u nouse git and github??
  • 46.
    Why u nouse git and github??
  • 47.
    Commands Overview  gitinit Initializes a git repository. git status  Check your changes made (untracked files, modified files, staged files) git commit  Save your changes into one commit history. git push  Push your changes in the remote repository. git pull  Pull changes from remote repository and apply it to your local repository. git fetch  Fetch changes from remote repository but changes will not apply to your local repository      
  • 48.
    Git and Github Git and github can be effectively used in project collaborations.  Can improve a developer’s coding.  Can avoid overriding or duplicating codes  Not just a developer tool
  • 49.
    “Whenever you areasked if you can do a job, tell'em, Certainly, I can! Then get busy and find out how to do it.” - Theodore Roosevelt