Hello World, Revisited... Again...

By default, the Form engine adds a .tpl to the PHP script file path, which is used as the template file path. For example, in the first example, the script with the form definition was named intro.php. Therefore, QCubed-4 used intro.tpl.php by default, since the HTML template includes the file ("tpl" indicates that it is an HTML template).

There are several reasons why you might want to use a different file name or even specify a completely different file path. In fact, the QCubed-4 code generator does this when it generates the form draft template files in a separate folder from the form drafts themselves.

The FormBase::run method takes in an optional second parameter where you can specify the exact filepath of the template file you wish to use, overriding the default "script_name.tpl.php".

Click the button to change my message.