
Ask HN: What PHP framework would you choose if you could start over? - kluck
Suppose you work at a company and a new project comes up with no reponsibility whatsoever to reuse existing code. The task is to create a web application based on a framework with the following features:<p>- GPL-compatible licence<p>- developed by community, not a company<p>- framework and application are written in PHP<p>- should be extendable via plugins&#x2F;addons&#x2F;extensions etc.<p>- cms features are included (or via addons)<p>- deployment features are included<p>- no php code in templates<p>- payment and shop features are included (or via addons)<p>What framework would you choose?<p>Also, feel free to share experience with web frameworks even if you don&#x27;t know any framework that might fit.
======
accnt
Laravel I believe matches most criteria above. Symfony would be a second
choice.

The driven factor though is community. This is key. No matter how good your
framework is if there is no community behind it to create, innovate, talk
about it and so on.

Worked with Zend framework 2, which I believe is a great PHP framework, but
the community is stagnant. We often have to create modules (libraries) for
things most frameworks already had (ie, Symfony).

------
uptown
Laravel

It's got the most active PHP community, and sufficient online support from
documentation and community. You could also start with Spark and let them
handle the boilerplate.

[https://spark.laravel.com/](https://spark.laravel.com/)

~~~
kluck
Does it match _all_ the criteria above?

~~~
joshstrange
Wow.... What a sense of entitlement. You ask HN a question and then jump down
a commenters throat for _potentially_ not meeting ALL of your requirements
(Some of which are not clear at all or, at least with the information you
provided, don't make sense at all: templates without code in them aren't
templates, they are static HTML pages...).

Laravel is a great suggestion and has been made multiple times in this thread,
it may not meet every last bit of your criteria but to disqualify it for that
reason would be ridiculous. There is literally NO framework or CMS that exists
that is going to meet _all_ your requirements.

~~~
kluck
My comment was not meant to "jump down" on anyone. Sorry for the
misunderstanding. It was a simple question (also because the Laravel answer
did not go into that much detail).

The reason why I added "templates without code" is because I have seen too
much abuse of php code in templates to even consider doing that again.

While you are probably right that there might not be (but who knows for
sure...) one framework that meets all the criteria, it is still worthwhile to
ask the community for suggestions.

------
oneweekwonder
Yii2[0] is simple, elegant and powerful. Unfortunately it does not adhere to:

> \- no php code in templates

But it does abstract the template/view nicely.

On a personal note and this will most probably get me down votes. I would not
recommend anyone to use PHP frameworks. But I understand real-life factors
like current skill set, dev availability, etc.

[0]: [https://github.com/yiisoft/yii2](https://github.com/yiisoft/yii2)

~~~
rdoherty
I agree, and I've used Laravel too. Yii is built and designed by someone who
has written frameworks before and understands how to do it right. The creator
wrote the Prado framework, then wrote Yii from the ground up.

Laravel definitely has all the hype, but Yii has been around much longer and
is better architected imho. It does have a slightly steeper learning curve and
isn't as instantaneously easy to use at first, but it's worth the effort.

------
vansteen
Symfony 3 or Laravel 5.

Laravel has been created by Taylor Otwell. Here are his thoughts on Symfony 2
"vs" Laravel 4. It's from 2013 but it's still interesting to understand the
difference.

[https://www.reddit.com/r/PHP/comments/1bdln1/symfony2_vs_lar...](https://www.reddit.com/r/PHP/comments/1bdln1/symfony2_vs_laravel/c96ohf1)

------
conradk
I would choose Symfony. I believe it matches all of the above criteria.

And it has:

\- amazingly simple upgrade paths, backwards compatibility guarantee on minor
and patch releases

\- regular, non BC breaking, updates and new features

\- corporate backing

\- large ecosystem of "bundles", which are Symfony's addon system

\- cli tool for scaffolding, debugging and more

\- strong conventions that help keep code structure clean when you are in a
team of 2+ members

------
tangue
* - developed by community, not a company *

This rules out Symfony and Laravel which are imho the only sane options in
php.

Why do you need this requirement ?

~~~
jonursenbach
Laravel isn't developed by a company.

~~~
mikelbring
Laravel LLC

------
jordanlev
As someone with positive experience in Ruby on Rails, I would choose (and have
chosen) Laravel. Specifically version 5.1 which is the current LTS release.

It does _not_ have a CMS module nor an ecommerce add on as far as I'm aware,
but depending on the complexity of your requirements they might not be
difficult to do yourself (eg just a few pages of editable content with a few
wysiwyg editors here and there, and a straightforward shopping cart / checkout
experience using Stripe for payment).

If you absolutely need plugins for all the things in your list, I think
Symfony is probably your best bet -- but it is less of a cohesive framework
than Laravel, so you'll be mixing and matching things and doing a bit more
work on your end (but possibly worth the tradeoff).

~~~
shivakaush
> It does not have a CMS module

octobercms.com is based on Laravel

~~~
jordanlev
October is based on Laravel, but it is not a module that you can "plug in" to
an existing Laravel site -- hence it does not meet the OP's requirements.

------
_RPM
I wouldn't use laravel because it seems that the guy who made it hasn't yet
earned my respect as the dictator of the project. It seems backwards
compatibility is a real issue for his framework. He's no torvalds. I can't
trust him to not break things.

~~~
kluck
What functionality got broken?

------
preinheimer
Slim - [http://www.slimframework.com/](http://www.slimframework.com/)

------
grimmdude
Definitely Laravel. My company switched over at the end of last year and it's
been great. I think it meets all your requirements except for `no php code in
templates`, though I think you'll always have to have some minimum template
code for looping/displaying data in any framework.

~~~
jordanlev
fyi Laravel does _not_ use PHP code in templates. It has its own templating
language called "Blade" (which I personally don't like, so I swap out Twig
instead).

~~~
grimmdude
You can use straight PHP in blade templates if you want. Even with blade tags,
for the most part it's still just PHP.

------
jt2190
Use the framework that the team likes and wants to learn.

You're going to get the best value from a framework that is matched well to
the team's current skills and ambitions. Consider:

* Team currently writes procedural code versus Framework requires understanding of Functional Programming or Object Oriented Programming

* Team writes quickly and loosely versus Framework requires developers to code methodically and carefully (perhaps because it has less "out of the box" features and more "flexibility". Security is a good example here.

* Team likes technical challenges versus Framework makes coding routine boilerplate and boring.

etc.

------
throwaway2016a
A lot of people here are saying Laravel. I agree. I haven't done a new site in
PHP in a long time but I did jump back and try Laravel for a bit and was
impressed.

------
Juliate
What's the scope/role/purpose of your app?

~~~
kluck
Responsive UI for non-web system. But noone knows what the future brings so
we'd rather build this thing on a solid base.

------
zhte415
Basically 2 stages:

Migrate existing code to something you're stable with.

Then go on improve it, standardise, basic migration path.

PHP, or .NET or Java, doesn't matter a lot. Get the job done.

------
arippberger
I'd argue Laravel and Symfony's development are tightly coupled to a single
person / company (Taylor Otwell / SensioLabs). If CMS & ecommerce are a big
portion of this project I'd easily pick WordPress. The only requirement it
fails to meet is "no php code in templates". WordPress meets all the other
criteria and it is generally great for spinning up a MVP.

~~~
gremlinsinc
Wordpress is good if you need posts/blog-like site, but if you're going to
scale up to something really huge like Groupon did, you'd be better off with a
custom framework w/ full control, better caching, etc. -- Wordpress is a hog
on resources, and very easily hacked as well. My laravel sites all perform
light years better/faster.

------
KayL
Depending on projects I'd choose between Laravel & WordPress. I like the
simplicity of these 2 systems.

------
SadWebDeveloper
> What framework will you choose if you could start over?

Anything that is not Python or Ruby or NodeJS based, i had so many problems
and nigthmares with Django/Flask/RoR/bottle.py/web2py/Meteor/etc.

> He say PHP Framework...

Anything but CakePHP, Zend or Code Igniter maybe Laravel or Slim.

~~~
whamlastxmas
There is a lot of Node.js frameworks out there. Meteor is not really
representative of them. Did you have issues with other Node.js frameworks too?

------
3ds
I realize that this is not in line with the PHP requirement, but hear me out:

I would use Ruby on Rails.

I have transitioned from using Drupal to Symfony2 (sometimes with Sonata) to
using Ruby on Rails, and let me tell you, everything is indeed greener on this
side. The tools are better, the language is easy to learn and it is mostly
sane. The framework is amazeballs, I am not even kidding. Writing tests is
actually fun. In general, I am a much happier developer with Ruby on Rails. I
would also dare to say that RoR makes me a lot more efficient as well.

In Symfony I'd frequently get stuck in finding a workaround for some weird
bug, which just doesn't happen that much anymore in Rails...

~~~
busterarm
I have to agree. Having gone from using Ruby/Rails to the PHP side and its
whole ecosystem, if you want an MVC framework I would say just use Rails or
Django. Laravel is somewhat painful by comparison.

Wordpress is quite fine for most things though.

------
the_common_man
Symfony 3 has worked out very well for us. I don't have experience with
lavarel or zend.

------
prophet_
Silex

------
stupang
Code Igniter and Drupal are my choices.

~~~
tumurinn
Worked on Drupal for half year and I swear that I will never touch this piece
of shit.

CodeIgniter is only good for very simple website. It miss a lot of functions
that a sophisticated framework has (eg Laravel)

~~~
busterarm
Drupal, in whichever flavors people are still using (5, 6, 7 or 8) is quite
bad. Avoid, Avoid, Avoid.

------
Sir_Cmpwn
If you have a chance to rewrite everything it's time to high tail it out of
the PHP ecosystem my friend.

~~~
kluck
Most people in my company have mostly been working with PHP and thus it would
be too much of a break with the past to switch languages.

------
dre85
I use Symfony and love it.

------
truentlolqt
ive used Yii and it was ight. Php sucks dick tho

------
justinph
Laravel or Slim.

------
tychuz
So you're looking for a CMS - Wordpress and friends - clone, and not a
framework?

~~~
busterarm
Right. This shouldn't be understated. If a CMS is a must, why isn't Wordpress
being considered?

~~~
kluck
We had some experience with Wordpress and from the list of features, it fits
the bill almost. Almost because we found the templates were very messy.

------
JeremyBanks
Django

~~~
Finnucane
BSD license, not GPL.

~~~
mikeokner
BSD 3-clause is GPL-compatible.

[https://www.gnu.org/licenses/license-
list.html#ModifiedBSD](https://www.gnu.org/licenses/license-
list.html#ModifiedBSD)

