2

I'm developing a SPA application and I can't decide, whether to use server-side MVC framework or not.

I have chosen AngularJS as the client-side framework. I was thinking I could use Symfony 2 on the server side, but I also considered using pure OOP oriented PHP. Something like this - database class, model classes (User, UserDbManager, ...). I would use something like Slim to create the REST API.

It seems counterproductive to basically write the same code twice, once on the client side and once on the server side, if I could just use the server to serve the data from the database.

If anyone had done similar decision, I'd be happy, if you'd share your thoughts and tips about it.

michy04
  • 317
  • 3
  • 11

2 Answers2

1

I would decide depending on the complexity of the requirement.

If it's a very simple I don't see a huge difference in using a framework or plain old php. But if it's a complex project, I would definitely go with a framework considering the fact that most of the core functions one might need are already there and quicker development. Again, it would come down to personal preference too.

Codeigniter has been said easy to learn for beginners in framework. Symfony and zend are more commercially used (I am not saying others are not, but I see more vacancies asking for symfony or zend development experience).

Ela Buwa
  • 1,652
  • 3
  • 22
  • 43
  • You are probably right. The project is middle-sized, it's not small, but not really large either. The framework would eventually turn out to be more useful than I thought. Symfony also provides nice integration with Doctrine, which I think will be really useful. Thanks for the comment. – michy04 Nov 11 '13 at 16:43
  • Yeah. I love it when you can use those ORM thingis with doctrine. The selection of framework would come down to how much you know about each framework and personal preference, scalability etc. Good luck with it. – Ela Buwa Nov 11 '13 at 16:49
  • Thank you again. I'm gonna review the needs of my application and choose the framework accordingly. – michy04 Nov 11 '13 at 16:57
1

My suggestion will be if you are having angular js as clientside framework. Then take advantage of it and use some api on server side to just return some json kind of response. Why send html on network when you have angular js on clientside to work with dom. just send data from server to client.

I have also done same. I have jquery for clientside and i am using spring mvc to send response as json.

Panther
  • 3,312
  • 9
  • 27
  • 50