Iam working on croogo and i have achieved all the things.But unfortunately the admin menus toggle effect does not work when uploaded on live server.When checked console,Shows this error in admin.js at line 37. I searched and found the below code making issue:
var $sidebar = $('#sidebar-menu');
var $topLevelMenus = $('#sidebar-menu > li > .hasChild');
// no item is current, fallback to current controller index
var $current = $('.sidebar .current');
if ($current.length == 0) {
var selector = _.template(
"a.sidebar-item[href^='<%= basePath %>admin/ +
<%= params.plugin %>/ +
<%= params.controller %>']:first"
);
if ($(selector(Croogo)).addClass('current').length == 0) {
var selector = _.template(
'a.sidebar-item[href="<%= basePath %>admin/' +
'<%= params.plugin %>"]'
);
$(selector(Croogo)).addClass('current');
}
}
Error Message : b>Notice (8): Use of undefined constant basePath - assumed 'basePath' [APP/Plugin/Croogo/webroot/js/admin.js, line 37
This is my first project using croogo.Can anyone help me out with this issue.Thanks in advance.
It is all because PHP configuration. On some configurations Notice Errors don't break the execution of code. But on some, mostly Linux configurations any error breaks execution. One of the cases is that there is some wrapper for JS files that adds error message to script and damage its syntax. Other case is that Notice message is sent before header is set and rest of code can't execute properly.
Most of those cases can be patched by adding this line to the first script executed:
error_reporting (0);
here is php documentation: http://www.php.net/manual/en/function.error-reporting.php
or in this particular case of CakePHP, in your /app/Config/core.php you can set
Configure::write('debug', 0);
This should help.
The php interpreter tries to parse a portion of javascript file as PHP. Try turning off php short tags.