Other PHP Functions

There are some methods from `$yugal` class that are useful, you do not need to define it as it is already defined in router file.

$yugal->style($csscode);

This method is used to add CSS code to external CSS file which will be defined globally. This can be called multple times and code will be appended.

$yugal->add_js($path_to_js_file);

This method is used to add external JS file to site globally. This method can be called multiple times, and scripts will be appended.

$yugal->theme($theme_colour);

Use this method to define theme colour to your site, this should be called only one time, however multiple occurence will not give and error, it will just keep updating the colour. Browsers do use it.

$yugal->favicon($path_to_favicon);

Use this function to define custom favicon to project apart from favicon.ico in root directory.

$yugal->script($js_code);

Use this function to define custom JavaScript code which will be saved in chunk.js, and is called on all pages. So use this function to define global JS, this function can be defined multiple times, it will just keep appending the code.

$yugal->libray($library_name);

Use this function to use installed library in the project, this function can be called multiple times.

$yugal->header($head_code);

Use this function to define Global <head> code for the project. This function should be called only once.

$yugal->_project_root

This variable can be used to call project's root path.

$yugal->noscript($html_code);

Use this function to define <noscript> tag on all pages of the project.

Last updated