News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Felix Geisendorfer's Blog:
How to oraganize your CakePHP App's Javascript II
November 24, 2006 @ 11:27:19

Continuing on from this previous post talking about Javascript in CakePHP applications, Felix Geisendorfer hands out more tips in this new blog entry targeted mainly at users of the jQuery Javascript library.

While the old solution was nice to manage the JS of a smaller application, this one is ment to structure your JS even in bigger projects. To make this possible I decided to go with a loose (MV)C pattern.

He gives an example of using a SiteController in connection with a CalendarController to help populate the information for the calendar.

0 comments voice your opinion now!
cakephp framework javascript oraganize part2 cakephp framework javascript oraganize part2


Felix Geisendorfer's Blog:
How to organize your CakePHP App's Javascript?
October 11, 2006 @ 13:06:00

In his newest blog post, Felix Geisendorfer stars up a discussion on where Javascript should live in your CakePHP application.

What I actually want to start a discussion about, is how one should go about organizing his custom JS code, especially when working with CakePHP. In my early JS days I used to have one or more JS files with a plain list of functions. Most of the time I ended up with ugly spagetti code, so I decided to change my approach.

Right now I use the JS version of a globally available Singleton that always has a sub-object called Behaviors that contains a variable amount of functions to be executed when the DOM is ready. The main advantage of this approach is that you can organize your applications functionality in hierarchies, while not having to worry about scoping issues.

He also talks about one of his current favorite Javascript libraries - JQuery - and demonstrates a way he uses to integrate it in with his application (in a Singleton style).

His is just one way to do it, though, and he's asking for suggestions of other ways to do it. Have one? post it now!

0 comments voice your opinion now!
cakephp framework javascript jquery location oraganize cakephp framework javascript jquery location oraganize



Community Events





Don't see your event here?
Let us know!


tool podcast series release voicesoftheelephpant library symfony framework list introduction security interview opinion version artisanfiles conference community composer laravel language

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework