I have an app in Yii and i want to ajax form submition without inline script unlike this link said, because inline script is bad for SEO.
So i create php file and put my js+php code in it with header
Header("content-type: application/javascript");
And include it as Javascript file. But java script return this error :
Fatal error: Class 'Yii' not found in /var/www/mydomain/js/sendmessage.php on line 16
Which line 16 contains:
var sendurl = request->getUrl() ?>+"/handler";
What should i do to make it work ?