We want our data store to be globally accessible to all plugins and the theme. But we want to control the access and interaction with the items in the store. Let’s talk about why both of these are important features.
Labs are hands-on coding projects that you build along with Tonya as she explains the code, concepts, and thought processes behind it. You can use the labs to further your code knowledge or to use right in your projects. Each lab ties into the Docx to ensure you have the information you need.
Each lab is designed to further your understanding and mastery of code. You learn more about how to think about its construction, quality, maintainability, programmatic and logical thought, and problem-solving. While you may be building a specific thing, Tonya presents the why of it to make it adaptable far beyond that specific implementation, thereby giving you the means to make it your own, in any context.
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.
Scoping – Who Can Communicate With Whom
Let’s talk about scoping, i.e. who can communicate with whom in your program. It defines the rules to define what code can talk with other code. This is a technical discussion which includes how memory is used and allocated.
Building the HTML View File
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.
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.
Variable Scope When Including Files
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.
Passing Variables By Reference – PHP Internals
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.