As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
By doing some research, one of the disadvantages often reported about Zend Framework is the amount of work required to get off the ground. For me this could be addressed if ZF had strong model and backend interface generators like Symfony does. I have been looking for those and here is what I found:
Model generators
http://code.google.com/p/zend-db-model-generator/: looks like official one, based on user feedback, the documentation seems to be awful though.
http://code.google.com/p/zend-model-generator/: seems quite advanced. updated 3 months ago.
https://github.com/inxilpro/Galahad-FE/: not updated in 2 years, looks dead.
https://github.com/codeinchaos/zend-model-generator/blob/master/generate.php: single php file, could be interesting to use as basis and extend as needed.
Backend interfaces
As usual one can use database administration tools
http://www.phpmyadmin.net: quite complete with plenty of new features since 3.5. Hard to extend.
http://www.adminer.org/: single-file backend interface. Quite complete. The use of plugins seems to make extending functionality easy.
Backend interface generators
http://zfdatagrid.com/grid/default/site/crud which comes from what looks like a very active ZF related project: http://code.google.com/p/zfdatagrid/.
http://www.koala-framework.org/: I've recently come across this framework which allows you to create "desktop-like" applications around Zend, which one could use to create a backend interface.
Setting up the interface seems to be quite easy, for instance here is how you would display a form to edit contacts on the same page as you would edit members:
<?php
class MemberContacts extends Kwf_Model_Db
{
protected $_table = 'member_contacts';
protected $_referenceMap = array(
'Member' => array(
'column' => 'member_id',
'refModelClass' => 'Members',
)
);
}
?>
A demo of Koala frameworks is available. To be honest it looks quite impressive.
Q: Which model generators and backend interface (generators) do you use for Zend and why?
I do not use any kind of generator, prepared backoffice or so called scaffolding.
Why I don't use them in a general way ?
These tools introduce a strong dependencies on the way the generated UI is structured, you do not have anymore the power to design it the exact way you want.
They are quite hard to reuse unless you know them very well, they introduce a lot of magic, for example when I create a backoffice using Django I've to set five parameters and I've a backoffice running. Understanding how it works do really need a lot of knowledge on the inner mechanisms of the tool, so updating it can be a real pain.
To my mind there's a strong difference between providing almost complete backoffice application like Symfony, Rails and Django do, and what Zend Framework do: constraining to general framework and libraries.
There is a deliberate choice between something working out of the box and something flexible. I think they tend to aim different needs.
I tend to prefer the Zend Framework approach since I'm not satisfied (nor experienced I've to admit it) with what others offer as an "almost done" UI.
Why I won't ever use them in Zend Framework ?
If Zend Framework doesn't embend such tools, I won't plug what others have tried to build upon it since nothing can guaranty that there won't be any regression on it (and upgrading can be a really good thing since Zend always integrate more and more external services). The power of Zend Framework is its flexibility, by overlapping tools over it, you're going against the philosophy of the product.
It might meet your expectation on really small project, but for bigger one I do really suggest you to build your UI according to your own needs, the backoffice will only take only you one or two weeks more.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I know this has been done many times before (some posts are really old so would be nice to get feedback based on current state of play), but I would like people's advice on which framework to use for a new application that we are about to start developing.Though we have set-up everything according to ZEND but now client's investor need to know why we choose Zend.
It was selected on the bases, out of 5 developers 2 are familiar with Zend. Now client want a detailed explanation why we didn't choose Symfony over Zend. Our reason is not enough to support our selection ;) so help me to choose which framework has what advantages over other so that we can present him solid reasons(for zend), and if symfony has more +ves then why we choose it(symfony) NOW. We can change our framework now.
I guess the correct answer is 'depends on what you're application and you're own requirements/preferences' so here is a brief description of the application and some of our own requirements:
The Application:
A financial transaction system extracting live transactions data done over thousands/millions of POS world-wide.
Few important things for project:
Database is already provided to us & it is an ORACLE database.
Oracle database has more than 86 tables. Some of the tables have more than 60000 rows of data at present & some of them have 79 columns too.
Our Requirements:
good support for jQuery
allow easy output of different types of output (HTML, XML, JSON)
easy UI development using in-bulit functions/methods.
ACL
fairly fast development (as always, schedule is tight)
nice clean business logic layer with freedom to architect the solution as we like.
a framework that helps you to get stuff done quickly but doesn't restrict you too much.
a good platform for doing other projects.
Any feedback from people who have used these frameworks (specially those who have used both) would be much appreciated.
Zend is not compulsion, but if changed to symfony, we need support for that. So support your answers with reasons, links.
Thank you.
Why Zend
First of all, I had my good experience over working with Zend Framework. It is most stable framework over all the php RAD Frameworks. Zend provides you jQuery builtin Class as Helper that will make it easy for you to make jQuery usage most easy. Even though, it provides the best usage with Dojo too. ZendX_jQuery class makes it easy for you to make use jQuery whenever you want. And, as you know jQuery allows ajax calls by $.ajax*() so it would be perfect choice for going through client side scripting.
However, I'll focus over the zend too because you can go through writing your API for most of the common transactions all over the site. As, ZEND provides Using AjaxContext with Zend_Rest_Controller and Zend_Rest_Route classes for this purpose that holds the Ajax context.
Zend has the best cache system. Even though, it provides the perfect search indexing using lucene. It is easy and stable to make your own re-usable component in your class library. CLI makes your structure delightful so no need to make everything manually.
No problem of managing templates. Action loads its view by prefix. View doesn't bounds you to have any templating engine. However, you can go through that too.
Layouts capability makes it extremely perfect to make generic and dynamic layouts that would be based over different of the controllers based upon ACL. And by ACL, i also got that Zend_Acl provides the complete solution over implementing out the ACL services. ACL is ofcourse the mandatory thing in your application.
Zend also provides you ability of having the modular structure of your site. Just plug and play your code snippets.
Why Symfony
I never gone too much deep over the symfony. However, I experienced it before for one of my project. Overall, as comparing, zend has decent folder structure then symfony. Symfony provides you ability to your code snippets but those snippets are known as bundle here. It has some templating styles that you need to implement in your views. It didn't found any built-in core library for implementing jQuery dynamically. May be, I would be wrong here but I don't know about it yet!.
I also got the same situation when I need to compare Zend & Symfony. But, after looking over all the aspects, I decided to go through the Zend.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've been using CodeIgniter for a long time, however lately I've been feeling the need to move to a more advanced/more OOP framework. Kohana seems to be an often recommended option, my question is, how exactly is Kohana different from CodeIgniter? A list of differences, particularly syntax differences, would be great.
I'll be writing about Kohana 3.1 and main advantages I've seen over CodeIgniter 2 so far. Before Kohana 3.0 (year and a half ago), I used CodeIgniter, ZF, Symfony, Cake and tried many others (at the moment trying to do Yii only because I have to). I'm aware that many will spit on me for "being subjective". Go ahead.
Strict PHP 5.2
Kohana doesn't use any of the old code (meaning 2.x or CodeIgniter's) in the current version. It was totally rewritten to be fully object oriented and not to get in developer's way. Simply put, it feels natural to develop with it, like it's "the way" for PHP development.
This is a framework built "by the community, for the community", not for promotional purposes. And not by / for any community but a very leet one.
CodeIgniter stood still for way too long hanging on PHP4. Looking at the CI2s' source, I can't say they've fully moved on to PHP5 (let's say PHP 5.1 isn't really ... PHP 5). I've seen FuelPHP, which seems to be more like a mashup of CI2 with Kohana than a CI2 branch, though I have to say it definitely has potential.
HMVC
The main reason for Kohana to feel natural was born out of this pattern. The idea was to isolate every request to respect the pattern and it ended up with respecting the RFC 2616. Now you have a separate Response object for each Request, being able to reuse your code in a really neat way. Right now I'm working on a web service which is used with iPhone, Android and the web app. I can't describe what a privilege it is to call the API "on the inside". Raw example:
public function action_delete()
{
$deleted = Request::factory('api/route')
->method(Request::DELETE)
->headers('Accept', 'text/html')
->execute();
$this->response->body($deleted);
}
No handicaps
The team behind Kohana is dedicated to making the framework "the best it can be", not "everything it can be, because we .. have too much spare time". Each maintenance version is backward compatible with previous ones (e.g. 3.1.2 with 3.1.0), having all "major" changes wait for the minor versions (e.g. 3.1 isn't fully backward compatible with 3.0 "out of the box"). Previous minor versions are maintained for 6 months after the new one is released.
Exten(ding|sions)
Kohana's Cascading File System makes it extremely easy to extend existing components, or even the ones used by vendors. You can override everything on application / module level, without thinking about setting include / load paths manually anywhere (because all files and folders respect the same convention).
There is a whole bunch of modules, including Zend Framework. How's that? Simply put, you can even use ZF or any other library as a module inside of your Kohana app.
Besides all the community built modules, every Kohana installation includes a few which almost every application can benefit from:
Auth
A simple, yet very powerful, authentication library. The module itself provides file auth driver only but enabling ORM gives us a more powerful one.
Cache
Caching library with drivers for most popular caching techniques: APC, eAccelerator, file, memcache, SQLite, Wincache and Xcache. It is extremely easy to implement and change (even later changes of the cache driver are a one-liner).
Codebench
If you need to benchmark some code, Codebench provides you a very simple way of doing it.
Database
As everything else in Kohana, database module is also fully object-oriented and extendable. Comes with full MySQL and PDO support.
Image
A simple module for easy image manipulation
ORM
Default ORM based on ActiveRecord pattern, fully using the advantages of the Database module combined with PHP 5 magic methods. Besides this one you can use Jelly, Sprig, AutoModeler or any other custom PHP lib like Doctrine.
Unittest
Kohana comes pre-packed with a great unit testing module. It's based on PHPUnit and fully "integrates" with your app, allowing you very easy TDD. Besides, the whole framework is unit tested.
Userguide
Altough ignored by most developers, this module is one of the most powerful Kohanas' features. It provides the easiest possible way of tracking your API and the rest of Kohana documenation. Why wouldn't your application have its' own guide as well? You don't even have to think about it! As long as you keep track of comments / conventions in your code, this module will take care of the rest.
Code examples
Code is neater than CI's, having all classes autoloaded, though conventions are very similar.
Update example (using ORM):
public function action_update($post_id)
{
$post = ORM::factory('post', $post_id);
$errors = array();
if ($values = $this->request->post())
{
try
{
$post->values($values)->update();
$this->request->redirect('post');
}
catch (ORM_Validation_Exception $e)
{
$errors += $e->errors();
}
}
$this->template->content = View::factory('post/update', array(
'post' => $post,
'errors'=> $errors,
));
}
In this example ORM is used to update a row, having update() call it's check() method to validate it's values. In case that validation fails, ORM_Validation_Exception is caught and the rest of try block isn't executed (i.e. redirection to /post). In the end, both the post object (Model_Post) and errors array are passed to View where they can be accessed directly.
Notice that all Database_Query_Builder methods are available inside of ORM, so you can also do 'fancy' stuff like:
ORM::factory('post')
->where('user_id','=',$user_id)
->join('users','INNER')
->on('users.id','=','posts.user_id')
->find_all();
Or (with relations):
$user = ORM::factory('user', $id);
foreach ($user->posts->find_all() as $post)
{
foreach ($post->quotes->find_all() as $quote)
{
if ($quote->illegal())
{
$quote->delete();
}
}
}
Where illegal() can be some custom model-level method with fancy joins and stuff. I'm aware how inefficient this chunk looks like, it's just a code example, not "are JOINs better than additional queries" :)
Please have a look at https://stackoverflow.com/questions/717836/kohana-or-codeigniter where the link - http://onwired.com/blog/exploring-kohana-as-an-alternative-to-codeigniter/ - answered most of this very same question to me.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
In the jungle of frameworks out there, I've come to the conclusion that I cannot simply decide on a framework without considering the type of application / site I want to create. I think I need a little help with determining this one.
This site is graphics heavy, with all of the content presented in a small <div> in the centre of the page, surrounded by graphics. The graphics around it should preferably be loaded only once.
The site will allow users to log on with their account and choose from a number of pre-made food recipes, or create their own. Then they can press a button to have the site generate a week or two of dishes.
The users will need their own control panel where they can customize stuff as wallpaper, dishes, labels etc. As well as browsing recipes, adding ingredients, and looking up which dishes they can create with the ingredients.
As mentioned, all of this data is supposed to be presented inside a square in the centre, so we need a system of jQuery panels. I was thinking of dynamically adding content to this square as needed. For example, emptying the content and adding new content to it when clicking links, etc.
We don't need any community per se; the possibility for discussion can be explored in a separate, external site.
I should mention I am more of a designer than a programmer. I get stuff pretty easily, but fear I don't have the capacity to create a framework like this from the ground up. I do know a bit of Visual Basic, but I'm not so good with C# syntax. I've never even touched PHP, but my partner has. He's also somewhat familiar with Java.
Basically, we need a framework that's easy to understand and get up and running.
I rolled my own framework based on http://kissmvc.com/. It allows you to basically do what you need in PHP but gives you an easy MVC framework to do it in. You don't have to learn the specific syntax to Zend, Cake, Code Ingiter or Kohana, all of which I played with before I found kissmvc. Based on a blog post by Rasmus, it was all the direction I needed and I love what I have now for reasons #animuson mentioned.
Rasmus' post: http://toys.lerdorf.com/archives/38-The-no-framework-PHP-MVC-framework.html
From what you write, I would say all "big, famous" frameworks will be able to do this fairly "easy"... So You should really define a few prototype tasks and check out a few of the frameworks. You should be able to solve this using, CakePHP, Symfony, CodeIgniter, Yii, Zend, or any other framework, so it is better to do some real testing.
You might look for a framework that has a tight integration to jquery, but this should not be a showstopper, since you should be able to implement this in almost any framework.
You might also consider footprint and execution time, and find a framework that performes well and is not too cpu heavy (read Yii or CodeIgniter for instance).
Good luck in the search
Ultimately if you want it to fit your needs you need to build your own framework, otherwise there will always be limitations. Keep in mind that there is no framework that you can simply install and tell it to do these things, you are going to need programming knowledge of how the framework works in its entirety and how to program your custom pages to work with those features. I found it easier to just build my own framework. That way I always knew exactly what everything did and if I needed something additional, I could easily add it in the correct spot without doing much thinking on it.
A framework is only the base materials and functions you need. If you're looking for something like a pre-built website such as PHP-Nuke or a forum system, you're looking for a content management system, not a framework. A framework generally comes with absolutely no pre-built pages. Might I add that some content management systems do come with their own framework and some use existing frameworks from elsewhere.
So, we basically need a framework that's easy to understand and get up and running.
well as far as the above statement is concerned you may want to have a look at cakePHP framework.
You will easily find help on cakephp framework on stackoverflow and cakephp google group. Response will be quite fast on both the sites.
You will need to go deeply through the documentation of every framework that you plan to use because with a functionality that you are planning to built would require you to study the framework quite well.
With cakephp you will be able to create CRUD (create, update, delete) operations quite easily with less effort, but for further functionalities you will have to study it's documentation and keep your cool while you learn it :-)
I have always found plain php to be all the framework I need.
PHP itself has all the features provided by the other frameworks
A superb templating engine, database access, parsing, and control logic.
The great thing is all these features implemented in a single unified component called "php".
The main problem is you need discipline to separate presentation, navigation, busines logic and database/persistence handling. You can have sql statements mixed in with your html, you can emit html directly from an sql statement in fact you have complete freedom to implement all the known anti-patterns and invent some of your own.
The "Java" and "Perl" frameworks generally provide things like request handling, template handling etc. which are missing from the basic language, but, these features are built into php. Most of what the "php" based frameworks do is force you into (a very sensible) MVC design pattern and save you a tiny bit of coding.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have some exposure to CakePHP and think it is a great framework.
Then, I run into this thing called Qcodo. It is another PHP Framework.
I've been hearing Zend alot. They all seem very neat, but I'm wondering what are differences between all these frameworks.
Before I waste too much time learning another framework,
does anyone know pros and cons of each framework?
They all seemed to have the general goal: making web application development in PHP easy, modular, and scalable.
EDIT
Found this interesting comparison result between CakePHP and Zend
I have never heard of Qcodo.
CakePHP is a full featured framework with a lot of automagic, but unfortunately it is one of the slowest frameworks out there. It also doesn't have official forums, and there really isn't that busy of a community. It tries to be a Ruby on Rails clone, but that just doesn't work so well with PHP.
Zend is impressive. It has a strong community and a corporate backing. It is very featured, but it is also very bloated (see that benchmark) so it has moderate performance. From what I hear though, you are able to use the components separately without using the whole framework, and can even use them with other frameworks!
I use CodeIgniter at work and I love it. It is by far the most newbie friendly framework, and with your CakePHP experience it should be a breeze. It has very good documentation that is thorough, clear, and well written. There are a few features that it doesn't have (such as an ORM) that other frameworks have, but CI has one of the most active framework communities I've seen. Since it's easy to write libraries for it, you can find a library to do pretty much anything you want to - ORMs, authentication, etc. To add to this, if you want an ORM for CI, I recommend DataMapper.
You may also want to check out Kohana. It's a spin off of CodeIgniter. It's strictly PHP5 and has an ORM and some more features. Haven't used it myself though, but I have heard good things.
I recommend reading the features of each and determining what you need and looking at code samples of the features you'll be using most.
Some frameworks may seem intuitive to you, but not to others. Selecting a PHP framework is a very personal choice IMO.
I've been using CodeIgniter myself after using CakePHP for some time. The main reason for switching was due to performance, but CakePHP has come a long way in the last few years so that's probably not a valid reason anymore.
[Edit: Apparently, it still has performance shortcomings, see post by ryeguy and comments.]
I've never found Zend to be intuitive and have never looked into Qcodo.
Wikipedia has a list of web app frameworks by language, you might find information to help you decide there as well.
I use both QCodo & Zend Framework
QCodo is a MVC framework of code generator, a lot of codes are ganerated from your database design, and produce ready to use Search & Edit Form for each of your database table. It also handle the database table relationship to pre-generate a set of methods for one-to-many / many-to-many relationship between tables.
Due to these codes were generated from your database design, all the codes were optimsed for each project. In short, It is a framework of database oriented
...................................................
Zend Framework is designed, as far as I know from the founder of this project), to decouple all the models, and indeed they are deploying a lot of ready to use models for different kind of project, from the Zend_ACL (access control list for authenication), to Zend _Search _Lucene, Zend _Service _Twitter, Zend _Service _Flickr, etc). And I think there will be for the future.
My vote for Qcodo! A while ago I did a research to what suited me best, and the result is qcodo, nowadays I can't do a project without considering to use qcodo, or at least his database handling part which is absolutely fantastic.
I think Simfony is the best PHP framework although I have not use it. I used mainly Qcodo/Qcubed but I am moving to Rails, this is why I find Simfony not bad. I tried Code Igniter and is not, it is simple to use, light (I suppose), but it does not have any scaffolding, but this might be changed now. As another guy said you can use an external ORM because CI does not have one by default. Zend Framework has a very modular architecture and has many libraries. I used Zend_ACL but permission inheritance was a pain so I did my own implentation, Zend_Lucene queries did not found the data I needed... ZF is a very low level framework and it needs an ORM too. I had a look at CakePHP but I found it its database interface not at the level of Propel, Qcodo and Doctrine, but I think the you can use your own library.
I usually want in a framework:
ORM and object wrapping the real row in the database ($objUser->Name = 'Jack')
MVC - most of the are MVC
Code generators (Qcodo is fantastic to code generate from the database)
Front controller, routing and url friendly (Qcodo does not have one)
Clean template (Qcodo has $objLabel->Render(); not real tags)
helper methods like link_to, image_tag etc (Simphony and Ruby on Rails)
Database migration to keep track of DB changes
integrated testing framework to test the real application, not few isolated functions (Rails do that and may Simfony)
The community and popularity of the framework.
Most of the advanced PHP developers I met use Simfony, but this is from my personal experience only.
Concluding, I would use Simfony bit I strongly suggest to try Rails using Ruby or JRuby.
Determining the best framework should be a project-by-project decision. If you have a big database using the innoDB engine and lots-and-lots of relationships between tables, check out QCubed (Qcodo). I've seen no framework that handles complex ORM relationships - even reverse relationships with ease! It's also quite fast at handling complex queries (e.g. reverse relationship queries) - although performance in any framework depends largely on the coder's ability to write efficiently.
If you're building a CMS, then you'll want Zend or Symfony for the MVC capabilities. QCubed/codo supposedly is MVC based, but it doesn't seem as clearly laid out as Zend. QCodo also DEPENDS on never changing the structure of your database - One can manage, but it's a real pain to add new fields to a DB table once a site has been launched because it auto-gens custom classes for each table.
I use CodeIgniter mainly because it had really good documentation and has a reputation of being easy to use. Also, Rasmus said it was his favorite, which is admittedly a lame reason, but I've had no complaints.
Don't ignore Symfony, it rocks. I'd say its biggest strengths are a consistent "go with the best practice" approach at every level, a vibrant community and excellent documentation.
I;m using QCubed, the successor to QCodo. Its simply the best you can get out of an Open Source PHP framework. Is quite fast if you know how to make it work. The only downside is that the documentation is lacking. However, the examples site is great. Start using it and I bet you'll have a lot of peace! :)
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I almost never hear the word CakePHP without hearing the word Rails shortly afterwards. Are these two frameworks mainly similar based on how they adhere to the MVC model or do they have other significant similarities/differences?
One of the main attractions of Rails for me is how easy it is to do Ajax. Would that also be true of CakePHP?
CakePHP is like a cheap, bastardized ripoff of Rails. It tries to be like Rails without doing any of the stuff that makes Rails great. It kinda feels similar, I guess.
CakePHP has an Ajax helper that does something similar to the Ajax-related helper methods in Rails, so yes, in some way, it's also true.
But CakePHP is really an exercise in futility: its authors wrote it so they wouldn't have to learn Ruby, even though learning Ruby and Rails together is probably easier than figuring out the monstrous mess that is CakePHP.
(This, coming from somebody who does CakePHP at his day job.)
Since y'all asked, my biggest complaint about CakePHP is how it manages to totally butcher the conveniences of object-oriented programming: sure, it implements the Active Record pattern just as much as Rails does, but it makes you pass around data structures.
I feel like any logical person would implement an ORM using faulting and dynamic loading of properties in to objects, which is exactly what ActiveRecord (the Rails library) does. The whole idea of setting a member variable called $recursive to determine which relationships to load is just plain flawed.
Being based on PHP is pretty fatal, too; you can't do anything with global state, you have to depend on mod_rewrite, you pay the startup penalty on every request. Sure, there's optimizations for any environment you're using, but still. People say Ruby is slow, but my own Rails apps run faster than their CakePHP equivalents, last I checked. I admit to being without data on this.
Worst of all, the bugs in CakePHP just about kill it for me. I could tell any number of stories about
the time we spent two days figuring out why CakePHP refused to connect to the right database host
the time half of our pages went blank because of the memory ceiling from using too many components
the amount of code that lives in our AppController because every component load costs several megabytes of memory
the black art of massaging data structures to make XML output work correctly
how we traced down the blank <javascript> tag that shows up at the end of every page
Cake is laid out much like Rails and obviously takes a lot of inspiration & ideas from it. Cake is a nice introduction to MVC frameworks and rails seems pretty straightforward coming from cake experience.
Ajax is super easy with Cake using the JS helper. In fact everything is super easy. Its a great framework, especially for distributed apps (eg cms's) or any other situation where the ease of hosting a php app is a benefit.
I would see the main advantages of rails being Ruby (and therefore the better OO implementation of rails etc) and the community. Gems (much fewer / less comprehensive cake plugins), training materials online, books (eloquent ruby anyone?) meetup groups etc.
I haven't worked with CakePHP, but my impression of it isn't too good. If you're after a Railslike framework for PHP, I think you may be better off looking into Symfony. It's probably a bit more complicated to get started with, but the whole project seems much better organised than CakePHP.
Of course, take with a grain of salt, since these things are quite subjective.