⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Filtering from get params



nikita.b
  • profile picture
  • Member

Posted 19 April 2017 - 17:18 PM

Is there way to autoapply filter based on url params?
Example:
CRUD url is /users
if we go to /users?status=Active I would like to show all users filtered by this status.


xheradon
  • profile picture
  • Member

Posted 21 April 2017 - 06:50 AM

Maybe you can check $_GET with a conditional or switch to set $crud->where() ?


Amit Shah
  • profile picture
  • Member

Posted 24 April 2017 - 09:10 AM

Well it surely is a good option.. and i will recommend 1 more thing, add the same value to the session. There might be a possibility that you may loose the value in next call if it still dose not persist. So the best option i found was ... if there is a parameter, just push it to the session.. if there is no parameter.. and its not a call from same controller, just reset the param value from the session.

 

Happy GCing :)