⚠ 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

ADD_ACTION to an External URL and passing values



jdaganzo

jdaganzo
  • profile picture
  • Member

Posted 09 December 2013 - 15:26 PM

I am fairly new to Grocery Crud and I have read the documentation and searched the forum but I am looking to see how I can add an External URL instead of a link to another crud model within my application.  Here is my example:

 

    public function participant()
    {
      $crud = new grocery_CRUD();
      $crud->set_theme('datatables');
      $crud->set_table('participant');
      $crud->where('participant.EVENT_ID',1011);
      $crud->display_as('EVENT_ID','Event');
      $crud->display_as('DIVISION_ID','Division');
      $crud->set_relation('DIVISION_ID','division','{DIVISION_NAME}');
     $crud->set_relation('EVENT_ID','event','{EVENT_NAME}');
     $crud->add_action('Score', '', 'demo/action_more','ui-icon-plus',array($this,'score_participant'));

    }

 

    public function score_participant($primary_key , $row)
     {
        return redirect("http://www.example.com/add_score.php");
     }
 
 
When the PARTICIPANT model renders it wants to immediately redirect to my redirect page. I want to be a link that is external that I will eventually pass the row parameters to a custom external php page.  I have also tried to use SITE_URL, but that doesn't work cause it tries to build the base url for grocery crud with expecting it to go through the controllers.  Can someone give me a tip on how to make it go to a custom non grocery crud link and pass some values of the row to it?  
 
Here is a screen shot of my example.
 
 
 
JD