Answer the question
In order to leave comments, you need to log in
Does it make sense to do CRUD on yii2 without ajax?
I found a comment on Habré where a person is surprised that someone is doing without an ajax request CURD, and the comment was 2012, and got 9 likes, xs rofl was or not, but my doubts crept in
Answer the question
In order to leave comments, you need to log in
To answer this question, you need to understand several nuances:
1. This is 2012. A lot has changed in programming over the past 8 years . I believe that you need to study every six months and learn new technologies, as well as apply them in your projects.
2. Recently, jQuery has been actively abandoned . They are being replaced by frontend frameworks: Vue , Angular , React , etc.
In 2020 , most often, the project is divided into two applications: frontend (UI) and backend (API).
For frontend , a js framework is chosen , and forbackend choose, most often, a php framework .
frontend interacts with backend via API .
3. Nobody canceled the hybrid . There are applications that combine backend and frontend in one application. In such projects, they try to use js minimally.
Explore this question site and you will see for yourself that there are not many functions implemented on "ajax". If there are many such sections, then you should use the division into 2 applications from point 2. In a CRUD application, AJAX will be minimal.
My opinion :
1. If you don't know js well , thenuse it minimally in your projects, and even more so if it's jQuery.
2. Use CRUD without AJAX . It will be possible that there will be several forms on one page. Don't be afraid of this. Just think about refactoring.
3. Use "AJAX" in cases where you really need actions without reloading the page: likes, adding goods to the cart, adding to bookmarks, and so on. Such actions must be justified and reasonable.
Think about how you can implement this in one file for all CRUD actions. For example, I implemented filtering without reloading the page on all index pages. But you need to know well how the Framework works and be able to use it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question