Quick snippets to get you up to speed with the Yii PHP framework. By Neil McGuigan.
will you provide some examples? thanks
Why, whats wrong with jQuery? (vs ExtJS)
@Jeroen: If you're programming Web *applications* and not just Web *sites*, then you will immediately understand the power of ExtJS. I have developed in both, and I can assure you that the maturity of an integrated professional library of widgets simply doesn't exist in the jQuery world. Instead, you have to resort to using different plug-ins for every single task (e.g. jqGrid, jsTree, validation, autonumeric, etc.) and integrating those becomes a nightmare, not to mention solving the bugs of plugins barely supported by lone developers.@Neil: Assuming you are not using ext4yii, it would be very interesting to post your setup with Yii and ExtJS, i.e. directory structure, composition of views and controllers, etc.
Have you looked at jQuery UI?
I came across this because I am interested in the power of extjs with Yii.Do you use the Yii controllers and models returning JSON to the ExtJs app?Do you use the partial views from Yii at all?Do you store the data to MySQL?Seems like ExtJs is a MVC itself. Is Yii and ExtJs together better in your opinion?Can you give me some idea as to what you found was the best setup? And in a nutshell, how does a pure Yii application differ from a Yii & ExtJs application?Thanks for any experiences you can share.
@mark and @anonymousin my current project, we are using yii controllers and models, with no views (well, just one)ext sends json to a yii controller, which decodes it and loads it model(s). do some server-side validation, save to the mysql dbext also gets data from yii controllers, which queries db, puts the model and relations into an array and encodes as jsonext is unaware of any many-many relationships in the db, and assumes they are has-manyext 4 does mvc, but that is all client mvc. still need to do server-side validation, where yii helps out.hth
Niel,Thanks for the response. I had envisioned Yii and ExtJs working as you stated. That validates my thought process and gives me more confidence to integrate them both now. Can you elaborate on "ext is unaware of any many-many relationships in the db, and assumes they are has-many"?
@mark: ext doesn't support manymany. Also, you probably don't want to worry about that on the client anyway. For example, We would send a blog posting + its tags to the client in one response. Client might add a tag, send the posting + all tags to server to update, then server figures out how to save tags to db. Essentially all manymany, hasone, and hasmany relationships are hasmany in ext (hasone is coming in 4.13)
@Neil: Thanks again. One last question (for now). Are you using ExtJs solely as the view without business logic (controller) and model?
correction, the yii controllers don't read/write from the db, the models, do, but the controllers use the models to read/write to db
Great. Thanks Neil. I'd love to see this app you have! I'm planning on writing a desktop like app for my own business. On the surface, a fairly simple CRM but with enough uniqueness and industry oddities to build it from scratch. I can start by using small functions in my new app. Once I learn the be efficient at ExtJs and Yii and ....everything to build a simple application, I will have the skills to replace the existing antiquated VB app (without source) I bought. I'll be reading your blog. Thanks much.
@mark Sounds good!Yii has a few issues you will want to tackle upfront such as writing related records to db automatically. The advanced ar behavior extension should help. You will also need to write a function to write json for relations.I would get to know how gii works and then use gii to write your ext mvcs in addition to yii's mvcsExt 4.1 has some bug fixes and performance improvements and should be avail in a few weeks.Also check out Feng open source proj man tool to get some ideas on using php and ext together
Your blog open my eyes to bring together Yii and ExtJS.Thanks a lot @Neil.
ExtJS needs an overhaul of the general look and feel. It looks too much like Windows3.11 to me!Tom