How can I use YUI 3 in Yii framework? I searched on the internet and I couldn’t find anything
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can load any javascript library with Yii. You can add it to your layout (most likely
protected/views/layouts/main.php) like so:Assuming your YUI library is located at
js/yui/yui-min.js. This will now load that js file into the head section of every view that uses that layout.You can then use it as per normal. Keep in mind that jQuery is built into Yii, so you may have compatibility issues between jQuery and YUI. Check out this post on the jQuery website for more info.
I would also recommend having a look at the Yii CClientScript documentation here. The CClientScript class manages JavaScript and CSS stylesheets for views within Yii.