Tom’s Graphic Design Journal


research, thoughts, and reflections for print and web
NEWS: Long term side effects of xanax Cialis company Mazindol Buy cheap generic viagra Hydrocortisone Fill viagra prescription Selegiline No prescription phentermine Cefoxitin Viagra lawsuits texas Viagra alternative and woman Dulcolax? Metrizamide Cialis viagra Phentermine weight loss pill Valium! Viagra useage Overdose xanax, Viagra use in women Kaopectate Novobiocin Cheapest place to buy phentermine Adderall Trifluoperazine! Phentermine message boards Ipodate Nafcillin Buy phentermine diet pill Tramadol drug test Phentermine diet pill: Dexfenfluramine 5 mg Cheap tramadol Over the counter viagra? Herbal viagra alternative Nabumetone Budesonide Amitriptyline Good morning viagra commercial Carbenicillin Xanax indications Ambien cr dosage Buy vicodin online Phentermine and atkins diet 150 tramadol No prescription phentermine free shipping Digoxin Fioricet medication Pediacare Woman take viagra Xanax alcohol Phentermine pharmacies Phenelzine From generic india viagra Plendil Viagra lawsuits. Is phentermine dangerous Viagra 6 free sample Vicodin dosage Alteplase Natural alternative to viagra Clomiphene Ampicilin Cialis lowest price, Arava Hydroxyzine Klonopin vs xanax dosage Tramadol and online pharmacy, Didanosine Bush inauguration speech draft viagra bastard of. Meridia better than phentermine Information on phentermine Inform your doctor medication phentermine dose weight Generic viagra overnight delivery! Phentermine and sibutramine be combined Buspirone? Ingredient phentermine Delivery florida online pharmacy phentermine. Darvocet Phentermine 15 mgs Phentermine airborne express+cod Viagra jokes, Phentermine buy How fast can you loss weight with phentermine! Trihexyphenidyl Cialis ineffective Xanax tablet Is viagra safe for woman: Colace Inderal: Natural viagra Order phentermine c o d? Phenoxybenzamine Asparaginase. Mylan xanax Meridia Avapro Online pharmacy phentermine Viagra usage Mixing cocaine and viagra, Cholecalciferol Phentermine prescription online. Accolate Cheap perscription phentermine Natural phentermine Viagra online ordering Vicodin online Accupril Phentermine hcl side effects Adipex phentermine pill. Cod online tramadol Where to buy viagra online Online pharmacies phentermine xenical meridia Epivir Ways to inject xanax pills Cyclopenthiazide Medical information on tramadol hc Phentermine without a perscription, Link myblogde online order viagra Soft tab viagra Norgestrel Dyazide Buy online prescription viagra without Flutamide! Ipodate Buy meridia Vicodin abuse Viagra pills. Discount phentermine online Cialis eli lilly Half price viagra Phentermine phendimetrazine! Order phentermine diet pill Imitrex Lodine Butalbital fioricet Phentermine online consultation Percocet Phentermine mexican pharmacies online Interferon? Chlorhexidine Secobarbital Phentermine for sale Dutasteride Dopamine 5mg tablet Xanax dosages Picture of xanax pill Prevacid Substitute viagra, Cheap phentermine pills Carisoprodol Restoril No prescripton phentermine Bleomycin In use viagra woman Alesse Free try viagra? Mixing viagra and cialis Pulmonary hypertension and viagra Anisotropine Phentermine 6 pm order Cheap viagra uk Benzthiazide Phentermine cash on delivery Phentermine able to beshipped to mo Phentermine quick Femara Death cases from taking phentermine Phentermine no rx Fluconazole Non prescription phentermine Xanax on line Viagra testimonials Troglitazone Buy xanax online Furosemide Terazosin? Soma sleep Zuclopenthixol Cialis viagra Singulair: Pfizer viagra sperm Imuran! Buprenorphine Anafranil! Cheep paris france phentermine Side effects of tramadol hydrochloride Generic lowest price viagra Why phentermine? Viagra alternative uk Adipex phentermine? Elavil Levitra vs cialis vs viagra Prednisolone Phentermine Tolbutamide Generic viagra soft tabs! Piperacillin Generic soft tab cialis: Paromomycin Free phentermine prescriptions Phentermine dangers Viagra cialis comparison Xanax mg Buy viagra prescription online Compare generic viagra prices Uk viagra sales? Bupropion Generic viagra soft tab! Viagra impotence pill 30mg phentermine Cialis mexico Lowest phentermine Omnicef Iodamide: Phentermine amide Alprazolam xanax! Lisinopril Generic viagra cheap Neomycin Tramadol avinza drug interaction: Amrinone Lincomycin Ramipril Leuprolide Lowest price tramadol Viagra and levivia! Xanax libido Bromocriptine Ditropan Buying viagra on line Cheapest viagra price Celexa How does phentermine work First viagra commercial network tv Phentermine with no prior prescription Lasix. Grapefruit xanax Phentermine a159. Flosequinan Prometrium Online phentermine prescription Tramadol no prescription, Hydrocodone Fluvastatin, Generic viagra lowest prices Viagra samples Viagra Lunesta, Cerivastatin Isosorbide Order generic cialis Maxzide? Quinine Female use viagra Pravastatin Oxycontin Delivery florida online pharmacy phentermine Tramadol online discount cheap. Discount viagra sales Custom hrt phentermine Xanax cash on delivery Cheap cialis tablets Butaperazine Viagra Adalat Hydrocodone apap Viagra from canada Xanax anxiety: Xanax drug test Lexapro and xanax Viagra pill picture Ditropan Phentermine and diet pill 5 90 Nialamide Xanax federal express, Free generic sample viagra Imipenem Discount hydrocodone Buy cheap tramadol Buy xanax without prescription Mesalamine Cheapest place buy viagra online Hydromorphone, Buy cheap fioricet Citalopram! Amsterdam holland viagra Buy phentermine prescription Lexapro and xanax Drug vicodin Cialis results Cheap overnight tramadol: Where to buy xanax Minocycline Phentermine phendimetrazine Metoprolol Cialis order Viagra without a perscription! Fioricet Cheap tramadol cod free fedex Berman sister female viagra study Lortab and xanax without a prescription Atracurium Buy hydrocodone where Buy viagra now Diflucan About xanax Dulcolax Atenolol Tramadol? Xanax information Luvox and xanax Prescription tramadol Avelox, 5mg cheap Phentermine hoodia diet pill Phentermine faqs Tramadol without perscription! University rochester viagra pfizer Us pharmacy phentermine

Search My Blog

RSS Feeds

Articles
Comments

CakePHP + AMFPHP + Flex

March 30, 2007. Filed under: Web Design, CakePHP, Flex | Read 1 Comment »

Notes/Tutorial Here
So the big hype right now is Flex and it's definitely something I want to learn myself moving forward. It would be very good for any PHP developer to learn this as then they can easily use Flex (or Flash) with their projects. Especially because I can use it in Eclipse with my othe projects (an already familiar environment to me that also saves me from needing to run another application). However, I don't want to abandon everything I've been doing with PHP. I can live without Javascript (or at least heavy javascript effect libraries) for now. I love them, but they have a good bit of overhead and Flash is simply more advanced.

So Flex was the answer...especially because I can integrate it with my CakePHP applications. A lot of people have been wondering about it and a few people have even been working on some interesting things with CakePHP and Flex (thanks gwoo for tipping me off to the SVN of that project you were working on). So I took my stab at things.

There exists no real tutorial in how to do this yet. There is a wonderful article on AMFPHP and CakePHP actually linked on the www.cakephp.org homepage. This is a great place to start and it includes a vendor for CakePHP called "cakeamfphp" -- while there is a new version in the works, I'm actually getting away with version 0.60.Cake and Flex

I'm also using AMF0 and not AMF3. This is something that may change in the future as I learn more and as I run into the demand for AMF3. I'm sure it's fancier, faster, and all that.

However, the solution I've come up with is worlds shorter than what I've been seeing people try.

It's a mix between the CakePHP AMF Bulletin Boards example and Mike Potter's Flex and AMFPHP example available on Adobe's site.

The one thing I dislike about Flex is that it needs the data handed to it in a more simple level than CakePHP uses. Well, it doesn't, you can access the same detailed array structures that CakePHP uses but the DataGrid can't. More to the point, if you read Mike Potter's tutorial on AMFPHP and Flex, you'll see that he actually passes data from the MySQL database in a special way as to pass objects.

One of the first problems I ran into while trying to take Mike Potter's tutorial to CakePHP was flags about trying to convert objects to arrays, etc. Then after getting the data to pass, I ran the debugger and saw how Flex was getting the data.

It was an array of objects and more specifically, a multidimensional array of objects. It had [0] [Model] [Column] ... of course this is because with CakePHP, running a findAll() returns all the associated models as well. That's no good for Flex's DataGrid. I could specify the dataprovider to Flex as array[0][Model] and it would sure enough use all the columns and populate the DataGrid...BUT only with the first entry and not all of the entries.

In other words, I had to step out a level. The array was too deep. So that means [0] [Model] [Column] had to become [Model] [Column] ... more specifically [0] [Column].

So I ran Mike Potter's simple query to return an array structure like that. This sort of abandons Cake's default functions for returning data from your database, but I suppose that's the price to pay.

It's not bad though. You simply make your own "findAll()" for JUST the index type pages. You can still use findAll(), find(), findNeighbours(), generateList(), etc. for getting data to use elsewhere inside Flex, but you will just have to run other logic in Flex and you probably won't be using the DataGrid at that rate.

I'm at work, but I will post a full tutorial on how to get CakePHP, AMFPHP, and Flex working. However, if you're an advanced user you will probably be able to figure it out based on what I just explained. This post makes a good introduction or overview to the tutorial I will post soon.

Notes/Tutorial Here

CakePHP + AMFPHP + Flex

Notes/Tutorial Here
So the big hype right now is Flex and it's definitely something I want to learn myself moving forward. It would be very good for any PHP developer to learn this as then they can easily use Flex (or Flash) with their projects. Especially because I can use it in Eclipse with my othe projects (an already familiar environment to me that also saves me from needing to run another application). However, I don't want to abandon everything I've been doing with PHP. I can live without Javascript (or at least heavy javascript effect libraries) for now. I love them, but they have a good bit of overhead and Flash is simply more advanced.

So Flex was the answer...especially because I can integrate it with my CakePHP applications. A lot of people have been wondering about it and a few people have even been working on some interesting things with CakePHP and Flex (thanks gwoo for tipping me off to the SVN of that project you were working on). So I took my stab at things.

There exists no real tutorial in how to do this yet. There is a wonderful article on AMFPHP and CakePHP actually linked on the www.cakephp.org homepage. This is a great place to start and it includes a vendor for CakePHP called "cakeamfphp" -- while there is a new version in the works, I'm actually getting away with version 0.60.Cake and Flex

I'm also using AMF0 and not AMF3. This is something that may change in the future as I learn more and as I run into the demand for AMF3. I'm sure it's fancier, faster, and all that.

However, the solution I've come up with is worlds shorter than what I've been seeing people try.

It's a mix between the CakePHP AMF Bulletin Boards example and Mike Potter's Flex and AMFPHP example available on Adobe's site.

The one thing I dislike about Flex is that it needs the data handed to it in a more simple level than CakePHP uses. Well, it doesn't, you can access the same detailed array structures that CakePHP uses but the DataGrid can't. More to the point, if you read Mike Potter's tutorial on AMFPHP and Flex, you'll see that he actually passes data from the MySQL database in a special way as to pass objects.

One of the first problems I ran into while trying to take Mike Potter's tutorial to CakePHP was flags about trying to convert objects to arrays, etc. Then after getting the data to pass, I ran the debugger and saw how Flex was getting the data.

It was an array of objects and more specifically, a multidimensional array of objects. It had [0] [Model] [Column] ... of course this is because with CakePHP, running a findAll() returns all the associated models as well. That's no good for Flex's DataGrid. I could specify the dataprovider to Flex as array[0][Model] and it would sure enough use all the columns and populate the DataGrid...BUT only with the first entry and not all of the entries.

In other words, I had to step out a level. The array was too deep. So that means [0] [Model] [Column] had to become [Model] [Column] ... more specifically [0] [Column].

So I ran Mike Potter's simple query to return an array structure like that. This sort of abandons Cake's default functions for returning data from your database, but I suppose that's the price to pay.

It's not bad though. You simply make your own "findAll()" for JUST the index type pages. You can still use findAll(), find(), findNeighbours(), generateList(), etc. for getting data to use elsewhere inside Flex, but you will just have to run other logic in Flex and you probably won't be using the DataGrid at that rate.

I'm at work, but I will post a full tutorial on how to get CakePHP, AMFPHP, and Flex working. However, if you're an advanced user you will probably be able to figure it out based on what I just explained. This post makes a good introduction or overview to the tutorial I will post soon.

Notes/Tutorial Here

« Previous Page

Tom’s Graphic Design Journal is proudly powered by WordPress. Valid XHTML
Login