Sunday , 18 March 2018
Home / Tag Archives: classes

Tag Archives: classes

Data Attribute – Advanced JavaScript Tutorial

Data Attribute

HTML5 is fairly new and it’s slowly being adopted by all web browsers today. A special feature of HTML5 is the ability to define custom data attributes. A data attribute is your own attribute that can contain information about an element. Let’s update our document to this. [crayon-5aae818237690074501173/] To create a data attribute, you simply create an attribute with the …

Read More »

Selectors API – Advanced JavaScript Tutorial

Selectors API

The selectors API is a simpler way to grab elements by using CSS queries. If you recall, you can change the styles of an element using CSS. Here’s an example of how you would do so. [crayon-5aae8182385ca146828563/] To grab an element in general, you just type in the tag name. To grab an element with an ID, you type a …

Read More »

Manipulating Elements – JavaScript Tutorial

Manipulating Elements

Now that we know how to grab an HTML tag, let’s talk about manipulating the data inside. Manipulating elements is fairly easy. So, let’s first clear out our script. Then, add this bit of code. [crayon-5aae818238bdb507182379/] Just like last time, we store the tags inside a variable. Since there are 3 paragraph tags inside the HTML document, there has to …

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 »

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 »

Properties and Methods – PHP OOP Tutorial

Properties and Methods

Now, that we’ve covered some of the basics about object oriented programming, let’s move onto the next step. We’re going to learn about properties and methods. We’ll learn about what they are and how to use them. Using Properties and Methods Open up your pet.class.php file and update our class to this. [crayon-5aae81823a99c285066091/] We create a variable named petName. We …

Read More »

Classes, Objects, Instances – PHP OOP Tutorial

Classes, Instances, Instances

Let’s get started by creating our first class and learn a little about what classes, objects, and instances really are. You’ll find that creating classes isn’t so hard. Create a new file called pet.class.php. You don’t have to append the .class after your file name, but it’s common practice to do that so other developers know that this file contains …

Read More »
Want to learn how to create web applications with Node.js and SQL? Check out my course!
Get 93% off my course. You'll also learn how to build real world applications using Node and SQL. This is a limited time offer
Yes, I would like to get 93% off your course!
No Thanks!