views:

247

answers:

6

Hello, I have been looking for a good PHP MVC framework that is interested primarily in speed, security, and implementing the MVC design architectural style.

Some of the biggest beefs I have with a lot of the mainstream MVC frameworks out there is that they:

  • put view logic in controllers, or do things like:

    controller: $form = "a form here";

    view: echo $form;

  • I would prefer to write my HTML as HTML, and not as PHP, same goes for CSS and JavaScript
  • fail to integrate well with 3rd party libraries
  • leave me with a lack of options about how I want to do my database queries
  • rely heavily on command line PHP

The ideal framework would be something not necessarily lightweight, but something that concentrates mostly on implementing the MVC architectural style.

Has anyone used a framework that seems to fit this description?

+1  A: 

Try Yii Framework - http://yiiframework.com/

Sergey Kuznetsov
+2  A: 

Zend framework can be as comprehensive or lightweight as you want due to its modular design. I'm also a big fan of CodeIgniter as it is modular, extremely fast, and the MVC portion of it is very well done in my opinion.

Kohana framework is another lightweight PHP 5 framework which has taken most of the good features from CodeIgniter and improved upon them. I haven't used it since beta though.

Most popular frameworks are secure and have fairly good implementations of MVC, I'd suggest just staying away from the Ruby on Rail clones like CakePHP if you're mainly looking for speed and don't want the rapid development tools.

evolve
CodeIgniter is a pretty simple framework.
Chris
Zend and CodeIgniter are the two ones that I have used on projects. I thought both of them were decent, although there were small things in each of them I didn't like a whole lot. From the benchmarks I have seen Zend didn't run too well.Has anyone used a framework that isn't really mainstream that they really liked?
adaykin
If a secure framework is a big concern I wouldn't go with a less mainstream framework. However with that said I've messed around with http://www.kohanaphp.com/ which is based on codeigniter, but completely PHP 5. I really liked it, however when I tried it out it was still in beta, and didn't have everything I required. You might want to check it out.
evolve
A: 

Yes! I use Code Igniter, and it's awesome. It's what drives Expression Engine, and it's a good, simple implementation of MVC. It has great helpers, good libraries in general, but doesn't use any "magic" like rake/make/bake that you might see in Rails or CakePHP. I find it simple to use and a great asset.

Try their videos here: Video Tutorials

Alex Mcp
NetTuts+ also has a pretty good series of CodeIgniter videos. Here is a CRUD sample video: http://net.tutsplus.com/videos/screencasts/codeigniter-from-scratch-day-5-crud/
Chris
A: 

In Symfony, your code would have been:

Action:

$this->form = "form contents";

View Template

echo $form;

or with HTML:

<div id="myform"><?= $form ?></div>

(I like using short tags, YMMV)

There is a learning curve, but most of my development is creating the routes I want, editing the action to build the data, and then editing my view.

Mike Crowe
+1  A: 

I'd go for Zend Framework for the MVC stack, but if you wish to write HTML as natural as possible, you could try using PHPTal for the View part.

Since ZF is modular, you could easily integrate any other library with it. Also if you're interested, you could take a look at PHP Doctrine for the ORM stack.

Pablo Cabrera
ZF + Doctrine + PHPTAL would be exactly my advice.
Vadim Ferderer
Doctrine has evolved quite nicely over the years =]
Pablo Cabrera
A: 

Check out the Seagull Framework, it's MVC oriented, based around PEAR, and uses Flexy (or Smarty) for HTML templates.

http://seagullproject.org/

Clay Hinson