This project will improve the Simple Editor project we did in Chapter 4. Here, we will package an editor as a module, making it easy to use in many themes. We'll also make a little more use of PHP as a way of passing configuration options from the server to the client.
We are going to make some improvements on the Simple Editor, add a few features, and rewrite some parts in light of what we now know. We will call our new editor Better Editor.
When we wrote our Simple Editor back in Chapter 4, we had not yet learned about themes. Instead of using theme functions to edit our code, we simply built strings where needed. Here, we are going to progress to theme functions.
Also, Simple Editor had only a few buttons, and adding more buttons required laborious re-writing of the code. Several things needed to be changed for each new button.
In Better Editor, we are going to change the way buttons are created. We will make it possible for the server to dictate what buttons get created. This means we will be writing a little extra PHP code for this section. Once again, it is simple code. Even if you are new to PHP, this code should be easy to follow.
Now, let's create our module.
Was this article helpful?