Monday , 20 November 2017
Home / Tag Archives: methods (page 2)

Tag Archives: methods

String Object – JavaScript Tutorial

String Object

The string object is another object built in by JavaScript. Whenever you create a string, JavaScript will automatically give it the properties and methods of a string. To clarify a few things, you can sometimes access an object directly without having to create a variable. We saw how to do this with the number object, but with the string object …

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-5a123cb122910347228666/] 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 »

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 »
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