Reputation: 29025
Dont take it as a repeat of another question. I have seen other questions too but my primary concern is different.
I have come from a asp.net background. I am in habit of object orientated programming.
So, considering my C# background, asp.net approach, windows platform and my beginning on php (ready to learn anything condition), which php-framework should I use ?
My initial digging favours Zend but I want to ask the experts of stackoverflow.com.
Same question for drupal, wordpress, joomla.
Or should I quit php and start learning Ruby on Rails ? ;)
Upvotes: 2
Views: 978
Reputation: 657
The frameworks I tend to lean toward are Lithium and CakePHP.
Lithium is built from the ground up to be PHP 5.3+ native - so it is WICKED fast and insanely efficient. Objectively, I definitely prefer it over Cake, Zend, Symfony, Yii, etc. Also, Lithium was created by the guys responsible for Cake's very existence (it started out as Cake3, but was so different that it split off into it's own project entirely).
The one area where Lithium sort of hurts, is the lack of general community. You can get pretty good support via IRC, and the developers are extremely helpful - but it also doesn't have the following or thorough documentation that the "big boys" like Cake and Zend have, which is a shame.
I'm also very happy with Cake 2, as it's incorporated a ridiculous number of improvements for PHP 5.2.8+ (but it's still not entirely 5.3+ native). They have also revamped the insane conventions so that they actually make logical and consistent sense now (before 2.0, the conventions were completely inconsistent from model to view to controller). Cake is also better documented than Lithium and (I feel) even Zend.
All that said, Zend is pretty much the status quo. I no longer use it due to the simple fact that it is painfully slow and underperformant. But that's what happens when you have a massive framework created specifically to shore up weaknesses in earlier versions of PHP. I'm keeping a close eye on Zend 2 (which is currently in beta), as the main focus appears to be a hard push to take full advantage of PHP 5.3 (which, FYI, allows lambdas, magic methods, and all manner of other awesomeness).
So my biased opinion is: as of right now, Lithium kills everything else. Not by a little, but by a lot.
Cake 2 comes in a very distant second (not fully PHP 5.3 optimized). I wouldn't even think of touching Zend 1.xx, but once Zend 2 is officially available and production ready, it should absolutely be worth a good, serious look (unfortunately, that could be MONTHS away).
Upvotes: 1
Reputation: 10674
Agile Toolkit is a PHP UI framework, which comes with Object-Oriented User Interface. Pure HTML is produced when objects are rendered recursively. jQuery and jQuery UI widgets are used to enhance the output and implement AJAX.
Here is a simple code snippet demonstration how CRUD can be implemented and enhanced:
class page_users extends Page {
function page_index(){
$crud=$this->add('CRUD');
$crud->setModel('User',null,array('id','email','name','status'));
if($crud->grid){
$crud->grid->addColumn('expander','more','More...');
}
}
function page_more(){
$tt=$this->add('Tabs');
$tabs=$this->add('Tabs');
$tab=$tt->addTab('BasicInfo');
$tab->add('MVCForm')->setModel('User')->loadData($_GET['id']);
$tabs->addTabURL('../password','Password');
$tabs->addTabURL('../activity','Activity');
$tabs->addTabURL('../engage','Engage');
}
}
Interface is based on jQuery UI CSS Framework and therefore can be themed using Themeroller. Interaction with HTML, JS or AJAX is handled by Agile Toolkit but can be enhanced or replaced by developer. Above code alone will produce this:
The object structure is well-designed and can be used in major web projects. Agile Toolkit is available under OpenSource license.
See also: atk4
I'm one of the authors of this wonderful toolkit.
Upvotes: 0
Reputation: 3090
PHP dose not work this way. PHP uses the . for concatenation if strings ('string 1' . 'string 2'). You may want to look for a framework that supports chaining, I.e. $a()->b()->c();, but even then you will have to call native functions in 'the PHP way'.
Upvotes: -1
Reputation: 14184
Probably need to build this class yourself, along the lines of:
Manipulating Strings, OO Style - PHP Tutorials | Dream.In.Code
You can then use this class with any code, frameworked or not. [Editorial comment: I happen to be partial to Zend Framework]
With decent autoloading, it should be as easy as:
$greeting = new MyString('hello')
$upperGreeting = $greeting->toUpper(); // $upperGreeting == 'HELLO'
If that feels too cumbersome, then you could create a static create()
method in your class so you can chain it pretty easily:
$upperGreeting = String::create('hello')->toUpper(); // $upperGreeting == 'HELLO'
Upvotes: 0
Reputation: 1659
I'm not sure if there is a reliable PHP framework with much similarities to asp, but taking the parameter of "object-orientedness" I shall recommend you Yii. It's almost absolutely object-oriented. It's the freshest php framework among the "big guys" (zend, cake, codeigniter, symphony) and it's built in the top of PHP 5, which has major improvements on its "object-orientedness". It works on ORM. It has many advantages and it's growing so fast. Check it out: http://www.yiiframework.com
By the way, Yii is perhaps the most similar php framework to rails, so you may get and idea of it before going there.
Upvotes: 0
Reputation: 3846
I know CakePHP uses a String
class and that most of the library is object-oriented. I don't know if this will suit you but that's something to try !
But you can't in PHP use something like "string".doSomething()
, you've got to manually create the instance like new String("string")->doSomething()
Upvotes: 1