In past episodes, we talked about caching a collection of elements to avoid multiple returns to the DOM to fetch the elements. Let’s talk about it now in the context of the script you are writing. You’ll see an additional “why” of caching.
The variable $ does not have context and does not natively mean jQuery. It can also stand for Mootools and any value. You need to specifically initialize jQuery to the $ variable. Let’s talk about it in relationship to the IIFE. I’ll show you how to pass jQuery into the IIFE (yes, you can pass in objects) and then assign it to the variable for use within the IIFE’s scope.
Let’s continue now by working on the footer widgets and site footer area.
It’s time to build out the HTML structure and put it into the view. What is a view? Why do you want to use it? Let’s talk about the qualities of clean, quality code. You will also learn about how to load the view as well as the variable scope. To learn more about variable scope and including files, go to the PHP Variables Bootcamp.
In order to be proficient in PHP, you need to first know variables. It’s learn and do time. In this lab, you are focusing on user-defined variables, the data they represent, how they are passed and assigned into function parameters’ list, naming, and their scope. For Pro members, you learn more about the PHP internals, how variables are linked to their data, and how memory moves around under the hood.
PHP does Type Juggling and determines the data type of the variable based upon its context. You can learn more about PHP Type Juggling in the Docx.
Let’s see what happens when you include files into another file. What happens with the variables between the files? In this episode, you will write code to include a view into a function and then access the variables between the files.
Let’s see how namespacing affects variables.
Now you’ve seen passing by reference in action. Let’s dive into how PHP manages it. You’re going into the PHP interpreter and its C language code.