Snippets are executable PHP code objects that provides some functionality when called.
In the previous example,
NewsEditor is a snippet. The only content of the Post a Blog! page was the call to the
NewsEditor snippet; the snippet takes care of displaying a form and storing the values entered through it as a new document. There is a whole chapter on Snippets in this book (Chapter 8, Snippets). In this section, you will learn the bare minimum about snippets that is necessary to follow along in the ensuing chapters.
Most snippets return an output that gets shown in the template at the same location from which the call to the snippet was made.
Such output can be returned by snippets in two ways: