It looks like you're new here. If you want to get involved, click one of these buttons!
$this->load->library(
'form_builder',
array(
'id'=>'addComment',
'form_attrs' => array(
'method' => 'post',
'action' => 'refund'
),
'submit_value' => 'Refund',
'textarea_rows' => '5',
'textarea_cols' => '28'
)
);
$fields = array(
'name' => array(
'label' => 'Amount',
'required' => true
),
'notes' => array(
'type' => 'text',
'label' => 'Notes',
'required' => true
)
);
$this->form_builder->set_fields($fields);
echo $this->form_builder->render();
Comments
For the refund form, you'll need to create your own controller and add the form there. I just did this for a project where I had a projects_model that needed to trigger a modal window that displays who to notify. The who to notify was a series of checkboxes outside of the context of the orders and needed its own form. I wound up creating everything in it's own advanced module (outside of the application directory... for portability), and created a controller that would display the proper form there. To trigger the modal, I wound up using the module's js_controller and js_controller_path values to specify where to load the javascript code that would control the modal window. Below is code for the module configuration as well as the javascript I used:
// located in a folder called fuel/modules/proofer/config/proofer_fuel_modules.php
$config['modules']['projects'] = array( 'preview_path' => 'proofer/view/{client_id}/{slug}', // put in the preview path on the site e.g products/{slug} 'model_location' => 'proofer', 'module_uri' => 'proofer/projects', 'item_actions' => array('save', 'view', 'publish', 'activate', 'delete', 'duplicate', 'replace', 'create', 'others' => array('proofer/notify' => 'Notify')), 'js_controller' => 'ProoferController', 'js_controller_path' => js_path('', PROOFER_FOLDER), 'filters' => array('client_id' => array('type' => 'select', 'model' => array(PROOFER_FOLDER => 'clients_model'), 'label' => 'Client')), );
Located in the fuel/modules/proofer/assets/js/ProoferController.js
ProoferController = jqx.createController(fuel.controller.BaseFuelController, { init: function(initObj){ this._super(initObj); }, add_edit : function(){ var _this = this; // do this first so that the fillin is in the checksaved value //fuel.controller.BaseFuelController.prototype.add_edit.call(this, false); this._super(); // remove current binding from BaseFuelController $('.submit_action').unbind(); $('#notify, .submit_action').click(function(e){ e.preventDefault(); var url = jqx.config.fuelPath + '/proofer/notify/' + $('#client_id').val() + '/' + $('#slug').val(); var html = '<iframe src="' + url +'" id="asset_inline_iframe" class="inline_iframe" frameborder="0" scrolling="no" style="border: none; height: 250px; width: 850px;"></iframe>'; $modal = fuel.modalWindow(html, 'inline_edit_modal', false, null, null); }) } });
Hopefully this helps some.