I have inherited someone else's PHP code & am totally clueless about the language.
I want to add Babel from CDN into my page header right after React & ReactDOM local files are loaded, however, before the app javascript files load up.
Here is the relevant chunk where the files are arranged at: protected -> controllers -> appcontroller.php
public function includeStyles() {
$baseUrl = Yii::app()->baseUrl;
$styles = Yii::app()->getClientScript();
$styles->registerCssFile($baseUrl . '/css/DA_TemSelect.css?' . $this->version);
$styles->registerCssFile($baseUrl . '/css/styles.css?' . $this->version);
}
public function includeScripts() {
$baseUrl = Yii::app()->baseUrl;
$scripts = Yii::app()->getClientScript();
$scripts->registerScriptFile($baseUrl . '/js/libraries/jquery-ajax.js');
$scripts->registerScriptFile($baseUrl . '/js/libraries/react.js');
$scripts->registerScriptFile($baseUrl . '/js/libraries/react-dom.js');
Here is where I want the CDN Babel js file to load, i.e. right after React, however, before the following js files.
$scripts->registerScriptFile($baseUrl . '/js/aphrodite/models/Element.js?'. $this->version);
I should mention, I tried this link but to no avail.
I appear to be using Yii version 1.1.13 (as per the CHANGELOG).
Thanks,