Friday , 17 November 2017
Home / Tag Archives: all (page 10)

Tag Archives: all

Getting Started – JavaScript Basics Tutorial

Getting Started

JavaScript powers millions of sites worldwide everyday. Even this site utilizes JavaScript. JavaScript allows interaction between the user and the browser. JavaScript can also be used outside of the web. Not many know this, but you can also use JavaScript for server side programming and for creating apps! If you’re looking for a JavaScript tutorial, then you found it! This …

Read More »

Conclusion – PHP OOP Tutorial

Conclusion

This is the final tutorial. You now have a basic grasp on what object oriented programming is and how you can apply it to PHP. There’s more to it such as design. If you would like more information, then go here .http://php.net/manual/en/language.oop5.php One question, that I’ve been avoiding during this whole series is why use object oriented programming? Why use …

Read More »

Polymorphism – PHP OOP Tutorial

Polymorphism

Polymorphism is a pretty big word, but it’s actually a simple concept to understand. Here’s how it’s officially defined. Polymorphism is a programming language feature that allows values of different  data types to be handled using a uniform interface. That may seem a little bit confusing to most of you new programmers. Luckily, polymorphism is a light switch concept meaning once you understand …

Read More »

Type Hinting – PHP OOP Tutorial

Type Hinting

In some cases, you’ll find yourself needing more information passed into your methods. What if you wanted to pass in objects into your methods? This is actually possible with type hinting. Let’s learn how to do this and why it would be useful. Before we begin, we’re going to create a new class called Apple. Create a file called apple.class.php …

Read More »

Chain Methods – PHP OOP Tutorial

Chain Methods

It’s time to make our Pet class a little more interactive. We can make our pets walk and rest. Our pet can do a chain of events. Using chain methods makes running multiple methods at once cleaner and more efficient. Let’s learn how to use chain methods. In our Pet class, add this bit of code. [crayon-5a0f4d1690822200885822/] We’re using a …

Read More »

Magic Methods – PHP OOP Tutorial

Magic Methods

PHP provides some magic methods that run when an event occurs. You’ve already seen an example of a magic method with the __construct() method. This method runs when a user creates an instance of the Pet class.  Let’s take a look at some of the other magic methods we can use in our classes. Using Magic Methods In your pet.class.php …

Read More »

Interfaces – PHP OOP Tutorial

Interfaces

In this tutorial, you’ll learn how to create interfaces and why you should use them. They are very similar to abstract classes. At the end of this tutorial, we’ll discuss the differences and the benefits of each one. We’ll be creating something similar to our recipe and cookie class in our abstraction tutorial. Creating Interfaces Create a file called index.php …

Read More »

Abstract Classes – PHP OOP Tutorial

Abstract Classes

Today, we’ll be discussing what abstract classes are and how we could use them. There will be times where you’ll create a class that you don’t want anyone to use directly, but instead extend it. Let’s take a closer look at this Creating Abstract Classes We’re going to deviate from our Pet class for a bit. Mostly because we don’t …

Read More »

Static Methods and Properties – PHP OOP Tutorial

Static Methods and Properties

Let’s learn how to create static methods and properties. Anything that’s static is basically something that can be accessed without needing an instantiation of the class. You also have the advantage of having a value that is consistent through each instance of the class. Let’s take a look at this. Creating Static Properties Inside our Pet Class, add this bit of …

Read More »

Constants – PHP OOP Tutorial

Constants

Constants are variables that don’t change value during the lifetime of a program. Defining constants in classes are a bit different than defining constants outside of a class. Defining Constants In our CanadianPet class, add this bit of code. [crayon-5a0f4d16939a7112081705/] To define a constant, we use the const keyword. We then follow it by the name of the constant and …

Read More »
ULTIMATE WORDPRESS DEVELOPMENT COURSE
Want to learn how to create your own custom WordPress plugins and themes? Check out my course!
Get 93% off my course. You'll also learn how to integrate WooCommerce and BuddyPress into your projects. This is a limited time offer
Yes, I would like to get 93% off your course!
No Thanks!
close-link