-
Book Overview & Buying
-
Table Of Contents
concrete5 Cookbook
By :
The Loader class in concrete5 is useful for loading many different types of files in concrete5. We will use the Loader class to include and instantiate the Form helper.
Open /config/site_post.php in your code editor.
Make sure you know the "handle" of the helper that you wish to load. The handle is the name of the file that contains the helper class without the .php extension. As we want to load the Form helper, which exists at /concrete/helpers/form.php, the handle will be form:
$handle = 'form';
Load the helper using the handle:
$formHelper = Loader::helper($handle);
Let's double-check that the helper was loaded correctly by dumping the contents of the $formHelper variable:
my_debug($formHelper);
The Loader class includes PHP scripts, making it available for use. Also, when loading helpers, the included file will also be instantiated and returned, making it immediately available to use in your code.
If you need to load a helper...
Change the font size
Change margin width
Change background colour