Home >Backend Development >PHP Tutorial >javascript - thinkphp page jump problem
1.$this->success('Add successfully', 'User/list'); This is the way it is written in the manual, but in fact it doesn't seem to work. After the jump, user will be added after the current url. /list, I don’t know if it’s because I used pseudo-static,
2. Then I wrote $this->success('Add successfully', U('User/list'));, it can be achieved The page jumps normally, but for example, after I perform a deletion operation and jump to the list page, the previously deleted entries are still there, which is due to caching. Refresh once and it will be gone
Looking forward to answering the above two questions
1.$this->success('Add successfully', 'User/list'); This is the way it is written in the manual, but in fact it doesn't seem to work. After the jump, user will be added after the current url. /list, I don’t know if it’s because I used pseudo-static,
2. Then I wrote $this->success('Add successfully', U('User/list'));, it can be achieved The page jumps normally, but for example, after I perform a deletion operation and jump to the list page, the previously deleted entries are still there, which is due to caching. Refresh once and it will be gone
Looking forward to answering the above two questions
It has nothing to do with your pseudo-static; because you only wrote 2 layers; therefore; I don’t know which module you are in; let’s take the Home module as an example; the one you want to jump to is Home/ The correct
under User/list is $this->success('Add successfully', '/Home/User/list'); but it is not recommended to write like this; the correct posture is to use the U function $this-> ;success('Add successfully', U('Home/User/list'));
If you use $this->error();, the previously deleted entries you mentioned will indeed appear;
Under normal circumstances, $this->success() will not appear. situation; if it is indeed there; it may be cache;