Answer the question
In order to leave comments, you need to log in
Yii2 + Angular Why?
Recently, it has become fashionable to associate a php framework with a js framework. I read articles on the topic, but I don’t see any justifications, except for general phrases: “It’s convenient”, “It reduces the load on the server”.
I can't understand how it is convenient and where exactly the load on the server is reduced? In my opinion, you can also get it with yii + jquery. But I, as a reasonable person, admit that I can be mistaken. Help put it on the shelves.
In fact, I think that it doesn’t matter, for this question, it’s yii and angular, it could be another pair of frameworks.
So what is so tasty adds angular. Because as for me there is a duplication of logics.
Answer the question
In order to leave comments, you need to log in
to remove the hellish jquery sheet and binding events to css selectors
The first is the separation of Backend and Frontend.
The second is the ease of use of JS frameworks, the use of new technologies (ES20 **), a virtual home, SPA, and much more.
And as for me - if you are asking such a question, then it is unlikely that you need to combine it.
Maksim Timofeev Don't bother, use Yii 2.0 for both back-end and front-end, if it's convenient for you. Work with what is comfortable for you. To the end customer, snot about "oh, how cool he is, this ...", "your site is not completed yet, but it uses the most advanced technologies ..." nafig is not needed. He wants results!
Weird question... Do you understand the scope of Angular? It's basically creating SPA(Single Page Applications) aka evernote. You will never make a normal spa with jquery. Well, if your tasks do not go beyond "create a site with whistles and fakes" then yes, you will not need Angular ...
it will go to any framework for the backend and any for the frontend, not necessarily yii and angular, it can be express and react, it generally depends on what and why to write. well Jquery will lose anyway, most likely
In general, yes, about 'reducing the load on the server' always surprises me. Is client lag and slowdown better than insane loads for generating html on the server?
not reducing the load, you can do everything on jquery, but the readability and extensibility of the code, the speed of the programmer.
There are no routes in jQuery, no date building, no watchers, nothing else.
Although I personally like Ember more in this regard, although it has a higher entry threshold, it can do everything the same as Angular, but in addition, its code is much easier to maintain later.
why : declarativeness is not an indicator?
about duplication of logic : something is not clear what exactly is it about?
the whole problem of such articles is that their title indicates some popular framework from the backend side and angular from the frontend. although the main thing is the presence of a rest api, written no matter what, and an angular spa application that uses calls to this api.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question