For those who like coding in Flex (now Flash Builder) and like Flex's component-based development, you can have a very similar way of working this code structure in CakePHP using elements and javascript. I will use the JQuery framework with CakePHP for a UI widget, and show side-by-side comparisons with a similar Flex UI widget. This post should be of interest to anyone who creates both Flex and Javascript/HTML front end UI widgets, or who uses flex and want to broaden their skills to use CakePHP and JQuery.
I've made many search forms that query thousands of records and can return as many results, thus requiring pagination. For the first three search forms i've created, it ended up being a re-education every time with many conditionals and general monkeying-around with a side of tom-foolery: passing the search form variables to the pagination helper, checking to see if search parameters have passed, if not then set defaults, etc, etc...
So after the third search form I decided to spend a little extra time to make the process more streamlined, and hope you can find it useful as well.
So there I was, in need of attaching a hamster to a balloon with an elastic cord; I had the balloon and the hamster, but was missing the critical elastic. I googled for a half-hour and stumbled across a great Actionscript class by Maxim Sprey (thank you Maxim!).
I converted Maxim's AS3 class into a Flex mxml rope component where you can attach two objects to each end, an anchored object and a swinging object (which would be the balloon and the hamster respectively). You instantiate the component in mxml like this:
Pretty self expanitory- swingObject is the object attached to the end of the rope that swings, and the anchor object anchors the rope. I've substituted buttons for the hamster and balloon in this example for simplicity, but you can see the hamster and balloon version at tjmillerdoesnothaveawebsite.com, one of my latest sites at the time of this posting.
Drag and release the small button below in the example to see the full elastic effect.
To view this page ensure that Adobe Flash Player version
10.0.0 or greater is installed.
Either scripts and active content are not permitted to run or Adobe Flash Player version
10.0.0 or greater is not installed.
My name is Brandon Plasters and I'm an avid web application developer. To help promote my business I've decided to blog what I've learned along the way, to contribute back to the coding community- of which I can thank for 90% of my coding knowledge thus far.
I'd like to thank Miha Nahtigal for the lilblogs CakePHP plugin I used for this blog.
I also figured it's time to use alpha-channel .png images on my blog design. For the purpose of this blog I don't need backwards compatability for IE6, the reasoning being that if you're visiting a code developer's blog with an out-of-date browser then you've got a thing or two to learn about the web before even thinking about visiting a developer's site. It's all about target audience.