For that to work with 'create', the value for the foreign key needs to be in the posted data already. So setting it in the form_fields method (like a hidden field as you mentioned), won't work for you?
You probably already know this, but the first …
$p->save() will return the id value if saved without errors:
$user_id = $p->save();
Also, after save, you can access the user id like so:
$user_id = $p->id;
Try something like the following to see if it works for you:
... $upload_path = assets_server_path('graphics/', 'images'); $fields['file_name'] = array('label' => 'File name'); $fields['file_name_upload'] = array('label' => '... OR upload a fi…
I think what you may want to do is add a model hook to save your foreign key value. Check out another recent thread that may help:
http://www.getfuelcms.com/forums/discussion/584/save-related-data-to-another-table/#Item_6
If the page already knows the foreign_key value to insert, you could pass it as one of the $values to the form_fields method (first parameter) and set the value property on the field within the form_fields method.
For the admin, if you set the fore…
In the form itself, you can set all your profile attributes to have field names that create an array when posted. For example:
// in users form_fields method... function form_fields($values = array(), $related = array()) { $fields = parent::for…
Setting it in MY_fuel I don't think will work. You could create a js file and put your logic in there and then include it using a module's "js" configuration property. If it is an existing module, like "pages" you can use $config['module_overwrites'…
If you use _remap, it will use that method instead of "success" method in your controller. To grab parameters, you can always use $this->uri->segment(3)... etc. I found this post a while back trying to deal with a similar situation that I thou…
Try using the img_path function to pull up the image using the second parameter which is the module folder to pull from:
">
The main .htaccess blocks access to any files but should allow files in the assets folder thr…
You need to load that model and call that method on the model:
$this->load->model('fleets_model'); $options = $this->fleets_model->options_list('id', 'name');
Using the foreign key property will automatically do this for you though too.
The model's "options_list()" method is good for dropdowns:
http://www.getfuelcms.com/user_guide/libraries/my_model/table_class_functions
In your case you could try the following:
$options = $this->options_list('id', 'name');
Also, it looks like…
If the controller inherits from Fuel_base_controller, then it will require login. For your admin store controller, name it store_module.php and your front end controller just store.php.
The Fuel_hooks.php was moved a while back from the applications directory to the fuel/modules/fuel/hooks/ directory. The fuel/application/config/hooks.php is where it is including that file so you may want to check the path in that file.
The examples provided show the command to be run (the "command" field in the admin interface). I would try running that via the command line (e.g. the Terminal on mac or SSH to your server and run the command) just to make sure the command will work…
FUEL doesn't support multiple domains. Each installation requires it's own database setup application, and assets folder. I imagine it could be possible to set it up so that you have a bootstrap file for each domain that points to a different applic…
With regards to your questions above:
1. Currently, the javascript for inline editing is handled separately (which is a bit of a headache).
2. In the admin, you can add javascript with a simple modules "js" parameter
3. Do you have the latest versi…
Ahh... yes it's view_location (I changed it above to avoid confusion). Does this work for you when you add the module in the third parameter:
$this->_render('films/films_create_edit', $vars, 'films')
In your case, if you want to have an object and be able to sort, I'd recommend just using the find_all() method. The paginate function will always return an array and to do the sorting, you need to do:
$this->db->order_by('col', 'asc');
For the custom field, you should be able to use the following:
$form['my_custom_field'] = array('label' => ' My Label', 'type' => 'custom', 'func' => 'my_custom_field');
If your function is a method on an object, you can use:
array($my_obj,…
I think line 315 on the blog controller could probably include an additional check since both the $_POST and the $_COOKIE for the session could probably be faked by a bot. Would you mind testing the following out on your end to see if it helps fix y…
Dwoo will sometimes bomb on javascript syntax unless it is escaped. Try wrapping the javascript with a {literal}....{/literal} so it won't try and parse it.