I am talking about the CakePHP Helper. I want to load the JS files using the helper of CakePHP.
Consider that the construction of the Helper class will load all necessary JS files.
But, I need to call that Helper in a single view multiple times. So, it's possible that the JS files will be called multiple times. I want to load those JS files only once.
Can anyone help me to cover this?
This will be my Helper script
<?php
App::uses('AppHelper', 'View/Helper');
/**
* @alias Mathjax Class for helper
* @description This class is to define helper in cakephp.
*/
class MathjaxHelper extends AppHelper {
/*
* Constructor of the class.
*/
function __construct(View $View, $settings = array()) {
parent::__construct($View, $settings);
//login to load all necessary JS files.
}
function create() {
//this function will return the helper html
}
}