Yii Framework Forum: jquery - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

jquery Rate Topic: -----

#1 User is offline   Umut Gundogdu 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 103
  • Joined: 27-November 08
  • Location:Ankara

Posted 27 November 2008 - 07:05 PM

Hi where should we put jquery file and how we import into our site
0

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,892
  • Joined: 04-October 08
  • Location:DC, USA

Posted 27 November 2008 - 08:40 PM

If you want to explicitly include jquery in your page, you can call the following:
Yii::app()->clientScript->registerCoreScript('jquery');
0

#3 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 28 November 2008 - 07:32 AM

Quote

Hi where should we put jquery file

Also, notice that the jquery script is already bundled with Yii.
0

#4 User is offline   ecchanger 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 14-December 08

Posted 17 December 2008 - 09:18 AM

what about the plugins?
0

#5 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 17 December 2008 - 09:34 AM

Quote

what about the plugins?


Some are included, some others are extensions, and you could write your own wrapper extension for the plug-in you're interested in.
0

#6 User is offline   tyvon 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 22-December 08
  • Location:Ukraine

Posted 22 April 2009 - 04:24 AM

I did not quite get it. If I need to use a JQuery plugin, for example Datepicker, which is actually a folder consisting of many .js and .css files. Where should I put it best in the files tree of the application? And how should I publish it? Thanks.
0

#7 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 22 April 2009 - 08:16 AM

Quote

I did not quite get it. If I need to use a JQuery plugin, for example Datepicker, which is actually a folder consisting of many .js and .css files. Where should I put it best in the files tree of the application? And how should I publish it? Thanks.


Well, for a datepicker, you can use this extension. Now, if you want to use another datepicker, I recommend you to write a Yii widget as a wrapper for it, so you don't have to work with javascript code directly in your view (you can take the extension as an example). But, if you still want to work with javascript code directly, you'll need to place the files you mention inside a directory and then publish that directory as an asset.
0

#8 User is offline   tyvon 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 22-December 08
  • Location:Ukraine

Posted 22 April 2009 - 08:54 AM

Thanks, man!
0

#9 User is offline   Nathan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 40
  • Joined: 17-August 11

Posted 08 November 2012 - 05:33 AM

I noticed that using registerCoreScript jQuery loads towards the bottom of the <head>. How can I make sure it loads first?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users