Yii Framework Forum: Add jQuery Mobile - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Add jQuery Mobile

#1 User is offline   ekerazha 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 526
  • Joined: 10-October 08
  • Location:European Union

Posted 17 September 2011 - 08:15 AM

Yii already integrates jQuery and jQuery UI, it would be nice to complete the family with the integration of jQuery Mobile http://jquerymobile.com (Beta 3 now but probably final when Yii 2.0 will be ready).
Yii user #37
0

#2 User is offline   Thomas Jensen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 150
  • Joined: 01-August 09

Posted 17 September 2011 - 08:36 AM

I don't like the integration of client side libraries as such. It should be abstracted away in CClientScript and similar. One of the reasons I choose PHP (with Yii) over .NET is that I feel I have more control.

I work at http://inze.it where we focus on mobile websites. We use Yii and jQuery mobile in all of our projects and they seem to fit perfectly together. For example: I have extended the CController into a MobileController, which all other controllers extend. The MobileController ensures that the layout is only sent along with the first load. Since jQuery loads all following pages with ajax, it doesn't need the layout, and thereby saving both server and client side load time.

My conclusion: Yii 2.0 should be less attached to jQuery and focus on features like minifying and combining css and JS but could provide ClientScript and Html classes to support the jQuery framework.

If you like the idea of more PHP programming and less HTML, you could extend CHtml to a MobileHtml which makes use of jQuery mobile features. In fact I use that approach on links because it simplifies the views a bit.
0

#3 User is offline   ekerazha 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 526
  • Joined: 10-October 08
  • Location:European Union

Posted 17 September 2011 - 12:28 PM

You should suggest this elsewhere since I'm starting from the fact that jQuery and jQuery UI are already part of the framework.
Moreover, I think that having a jQuery Mobile ready framework would be nice, without having to workaround rough edges by myself.
Yii user #37
0

#4 User is offline   Thomas Jensen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 150
  • Joined: 01-August 09

Posted 17 September 2011 - 12:47 PM

You're probably right.

What do you mean by "ready"? My experience is that there isn't really any workarounds needed. jQuery mobile works very well with Yii. Do you have any examples?
0

#5 User is offline   ekerazha 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 526
  • Joined: 10-October 08
  • Location:European Union

Posted 20 September 2011 - 08:37 AM

Example

View PostThomas Jensen, on 17 September 2011 - 08:36 AM, said:

For example: I have extended the CController into a MobileController, which all other controllers extend. The MobileController ensures that the layout is only sent along with the first load. Since jQuery loads all following pages with ajax, it doesn't need the layout, and thereby saving both server and client side load time.


I think that it should be ready-to-use. Mobile-optimized websites are a milestone in web development.
Yii user #37
0

#6 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 20 September 2011 - 10:30 AM

It really has little to do with Yii...
"Less noise - more signal"
0

#7 User is offline   Thomas Jensen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 150
  • Joined: 01-August 09

Posted 21 September 2011 - 03:32 AM

The controller I've made is less than four lines, and is not even required by jQuery Mobile, it's just an enhancement.

View Postekerazha, on 20 September 2011 - 08:37 AM, said:

I think that it should be ready-to-use.

It is. No workarounds required. That's the whole idea about jQuery Mobile; it's based on HTML markup, to make it as easy as possible. All you have to do is load the JS file.

View Postekerazha, on 20 September 2011 - 08:37 AM, said:

Mobile-optimized websites are a milestone in web development.

Sure they are, my company sells nothing else than mobile websites.
0

#8 User is offline   ekerazha 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 526
  • Joined: 10-October 08
  • Location:European Union

Posted 29 September 2011 - 05:28 AM

Leaving aside the implementation matter, the original question was about adding jQuery Mobile to Yii, as jQuery and jQuery UI are already there and it would nicely complete the family. The argument that you can add it by yourself is just as valid as for jQuery and jQuery UI which are already there.
Yii user #37
0

#9 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 568
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 06 October 2011 - 08:37 AM

I agree with ekerazha, jQueryMobile simply should be a core script.
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
0

#10 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 06 October 2011 - 05:32 PM

No, definitely not.

I'd rather see support for HTML5 Boilerplate, with accessible media queries.
The rest would then be a piece of cake.
Without jQuery Mobile..
"Less noise - more signal"
0

#11 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 06 October 2011 - 07:12 PM

To see what you can do - entirely without jQuery Mobile - check this:
20-amazing-examples-of-using-media-queries-for-responsive-web-design

jQuery Mobile is great, like jQuery UI - but no serious web designer (IMHO) would use it..

I'd rather see Yii switch from using BluePrint to Skeleton:
http://www.getskeleton.com/

I am using it for my website:
http://www.jacmoe.dk/
Resize the browser window to see it adapt.
I haven't really finished making it responsive, but you get the idea.
Here's how it looks on iPhone:
http://iphone4simula...m/www.jacmoe.dk
And on iPad:
http://ipadpeek.com/...moe.dk (portrait)
http://ipadpeek.com/...moe.dk (landscape)

So, I'd rather see Yii using Skeleton by default.

Not even the author of BluePrint uses BluePrint these days..
"Less noise - more signal"
1

#12 User is offline   CGeorge 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 27-May 10
  • Location:Spain

Posted 07 October 2011 - 02:04 AM

View Postjacmoe, on 06 October 2011 - 07:12 PM, said:


I'd rather see Yii switch from using BluePrint to Skeleton:
http://www.getskeleton.com/



I agree, we should made a poll for this!
0

#13 User is offline   ekerazha 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 526
  • Joined: 10-October 08
  • Location:European Union

Posted 07 October 2011 - 07:50 AM

View Postjacmoe, on 06 October 2011 - 07:12 PM, said:

To see what you can do - entirely without jQuery Mobile - check this:
20-amazing-examples-of-using-media-queries-for-responsive-web-design

jQuery Mobile is great, like jQuery UI - but no serious web designer (IMHO) would use it..

I'd rather see Yii switch from using BluePrint to Skeleton:
http://www.getskeleton.com/

This has nothing to do with the original question. I'm saying that jQuery Mobile would nicely complete the family, as Yii already integrates jQuery and jQuery UI. I'm a serious designer and I don't have any problem with UI and Mobile.

Swithing from BluePrint to Skeleton for the default theme is another story.
Yii user #37
1

#14 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,614
  • Joined: 17-January 09
  • Location:Russia

Posted 07 October 2011 - 09:46 AM

Most probably we'll have multiple bootstrap application types (yiic webapp) and maybe an ability to create your own ones.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#15 User is offline   Davidhhuan 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 270
  • Joined: 08-September 09

Posted 19 October 2011 - 08:42 AM

there is no use to include jQuery Mobile to Yii code in my opinion.

if including it, i think yii is not a common framework, but a heavy framework.
no pain, no gain...

My Blog : http://cnblogs.com/davidhhuan
My website: http://sharefamily.net/
0

#16 User is offline   ekerazha 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 526
  • Joined: 10-October 08
  • Location:European Union

Posted 19 October 2011 - 11:27 AM

View PostDavidhhuan, on 19 October 2011 - 08:42 AM, said:

there is no use to include jQuery Mobile to Yii code in my opinion.

if including it, i think yii is not a common framework, but a heavy framework.


There is nothing of "heavy", if you don't want it, just don't use it. There isn't any reason to include jQuery UI and not jQuery Mobile.
Yii user #37
0

#17 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 19 October 2011 - 03:01 PM

I would rather see jQuery UI go.

As for jQuery mobile.. There are other more capable solutions out there.
Such as Zepto.js.
"Less noise - more signal"
0

#18 User is offline   ekerazha 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 526
  • Joined: 10-October 08
  • Location:European Union

Posted 20 October 2011 - 04:13 AM

Zepto is not based on jQuery while Yii is based on jQuery (jQuery and jQuery UI are bundled, jQuery is used for active controls etc.), just like jQuery Mobile is jQuery-based, obviously.
Yii user #37
0

#19 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 568
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 20 October 2011 - 05:47 PM

I just found this, haven't noticed it yet: http://yii.te.gd/doc...packages-detail
Doesn't this do the job?
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
0

#20 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 20 October 2011 - 08:17 PM

View Postekerazha, on 20 October 2011 - 04:13 AM, said:

Zepto is not based on jQuery while Yii is based on jQuery (jQuery and jQuery UI are bundled, jQuery is used for active controls etc.), just like jQuery Mobile is jQuery-based, obviously.

You sound like a broken record, dude.

I do not use jQuery UI at all when I use Yii, and I prefer it that way.

Zepto is 4K, and does pretty much what jQuery does.

It's highly recommended. ;)

Why lock Yii users in, when you don't have to?

I agree with Thomas Jensen: Yii 2.0 should concentrate on asset management, like minification, uinification, etc. - IMO it really needs to be improved.

Curious: what makes it so hard to just use jQuery Mobile??

Right now?

I don't get it. :)


"Less noise - more signal"
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • 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