# 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.clipbucket.com/fundamentals/basic-understandings/template-class-and-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
