Answer the question
In order to leave comments, you need to log in
How to implement Ajax partials loading for SPA implementation in Yii2?
Hello. Actually a message a question in a topic.
According to what I guessed, you can create a separate controller in order to inherit everyone from it later, and write some kind of router in it for Ajax loading of partials.
According to my idea (or rather, as I understand it), there is one view, and everything else is pulled to it asynchronously from its partials.
Kicks about the paradigm are welcome. PS The first attempt to create a SPA in life. I will be glad to comments and advice.
Answer the question
In order to leave comments, you need to log in
And what does Yii have to do with it? If you need to do template preprocessing, then yes. A separate route along which you can pick up templates. Or to make simply dynamic generation thereof.
But it seems to me that you can just take them as static. And if we are talking about SPA based on angularjs - in general, when assembling the client part, put this stuff in $templateCache.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question