# Template Class & Functions

```
//Class is initated as  $cbtpl
$cbtpl->Fetch($name);
```

Absolute Path of the Class File **/includes/classes/template.class.php**

Absolute Path of the functions file **/includes/functions\_template.php**

| Methods in Object      | Functions                        | Purpose                                                                                                                                                                                                                                                                                               |
| ---------------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ::fetch($file\_path)   | fetch($name, bool $inside)       | <p>This fetches a smarty template. in $cbtl->fetch() we provide an absolute path of the Template file while in fetch we only mention the file name so that we dont have to provide aboslute. </p><p></p><p>in fetch function, LAYOUT directory is automaticall appended if $inside is set to true</p> |
| ::assign($var, $value) | assign($var, $value)             | Assign a variable that can be used in smarty template                                                                                                                                                                                                                                                 |
|                        | Template($file, boolean $layout) | Add a template file in a List of files to load when Displa\_it(); is called                                                                                                                                                                                                                           |
|                        | display\_it();                   | Display it will render body.html found in Layout dir and loop all templates files that are assigned using Templatete(); method                                                                                                                                                                        |
|                        |                                  |                                                                                                                                                                                                                                                                                                       |

Further read

How to Edit a Template
