Pergunta

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.

Foi útil?

Solução

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).

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top