Adding a module record's id number to the URL parameter with the 'item_actions' parameter

edited January 2014 in Modules
I have a custom module "Orders" that contains this configuration line to add a Refund button for an individual order:

'item_actions' => array('save', 'view', 'others' => array('store/orders/refund' => 'Refund This Order')),

How can I add a URL parameter to the end so that the button will generate urls like this to be able to reference specific order IDs?

/store/orders/refund/1
/store/orders/refund/2
/store/orders/refund/3

Comments

  • edited 9:26AM
    I figured it out. Simply updated the line to read:

    'item_actions' => array('save', 'view', 'others' => array('orders/refund/' . uri_segment(4) => 'Refund This Order')),

    This is assuming my unique Order url in Fuel looks like this:

    fuel/orders/edit/1
    fuel/orders/edit/2
    fuel/orders/edit/3
Sign In or Register to comment.