Now that we know how to install extensions, it is about time to create our own.
An extension is a ZIP file that contains at least three files:
1.
license.txt
contains the license for the extension2.
Install.cfc
handles the complete installation3.
config.xml
contains all information about displaying the installation steps: field names, values, labels, page title, and so on
For this exercise, we will create an application which we can then install. So let's create a Famous Quotes App:
Under the
<Railo Install Directory>/webroot
, create a folder namedfamousquotes
.Create a file
quotes.txt
in ourfamousquotes
folder with the following content:Houston, we've got a problem... Oh my god, they killed Kenny! … and any others you can come up with, divided by a line break
Create
Quote.cfc
with the following content. This returns a random single line from thequotes.txt
file:<cfcomponent> ...