Chapter 9. PHx
So far in this book, we have learned how to develop our MODx site by using templates, resources, and chunks, along with snippets. Snippets provide the power of having decisions made and interacting with the databases. In short, the logical component is abstracted to the snippet, whereas the resources, templates, and chunks provide a way to show the content returned by a snippet, or the contents of a variable. In some cases, it may be necessary to perform simple conditional checks within the resources, or templates themselves. PHx—Place Holders extended—is a set of notations that makes this possible by adding a logic layer directly to the placeholder. PHx also makes it possible to format the output, for example by converting a string to uppercase, and so on. In this chapter, we will learn how to use this notation.