⚠ 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 forum is read-only and soon will be archived. ⚠

Edit page only

edit update

  • Please log in to reply
1 reply to this topic

#1 Puskás Gábor

Puskás Gábor


  • Members
  • Pip
  • 1 posts

Posted 04 August 2015 - 06:47 AM



I use the Grocery CRUD in my project.

I want use the Grocery Crud's edit page in my user space.


The edit page is looks good for able user editing her profile datas. But I don't know how do that.


Eg.: http://myproject.tld/profile is need to looks like this http://myproject.tld.../index/edit/321 but I want prevent the user switch back to the whole table look, and/or do anything other than save her datas.


Any idea?





#2 marlaaragao


    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 05 August 2015 - 12:58 PM



Your links are not working. I did this in my project. You must unset the operations (at least the list and back to list with unset_list() and unset_back_to_list()). When you render, grocery will raise an exception saying that you don't have permission to access the list operation (the grid). So you can catch it and redirect to the edit form. Example:

        $crud = new Grocery_CRUD();
        try {
            $output = $crud->render(); //this will raise an exception when the action is list

            $this->template->load('template', 'default_view', $output);
        } catch (Exception $e) {

            if ($e->getCode() == 14) {  //The 14 is the code of the error on grocery CRUD (don't have permission).
                //redirect using your user id
                redirect(strtolower(__CLASS__) . '/' . strtolower(__FUNCTION__) . '/edit/' . $theUserID);
            } else {
                return false;

Also tagged with one or more of these keywords: edit, update

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users