For your foreign key you can try something like this:
public $foreign_keys = array('foreign_id' => array('my_module' => 'my_model'));
Also, you should be able to use this syntax as well to load in a model from a different module:
$CI->load-…
Do you have any additional information on how you want to use the REST controller and the fuel users module? You may already know this but you can load the fuel users model like so in the controller:
$this->load->module_model(FUEL_FOLDER, 'use…
Yep... that controller inherits from Fuel_base_controller so you should have all the base functionality there as well.
I've updated the online user guide to help avoid that confusion as well as to fix the (:any) typo in the route.
Phil Sturgeon has a tutorial on building a RESTful API with CodeIgniter if you haven't seen it yet and may be a good place to start:
http://net.tutsplus.com/tutorials/php/working-with-restful-services-in-codeigniter-2/
If you use the model's "save()" method, and the saving data has the appropriate key values provided, then it will do an update, otherwise it will do an insert. So in your case, you may try something like:
$this->my_model->save($_POST);
However…
I'm sorry but I'm not quite sure I understand so a couple of questions:
1. Where is the $_POST coming from?
2. Where is $data coming from with your insert_batch statement
As an FYI, find_all_assoc will give you an array result set with the key val…
The first parameter "module" refers to the module key name in your MY_fuel_modules.php file. It uses that value to get the module information including what "model" is associated with the module using the "model_name" parameter". The other "module" …
FUEL tries to parse out PHP code to make it Dwoo templating code compatible. You can set the "sanitize_input" configuration parameter for your module to FALSE to allow regular PHP code but it is not recommended for security reasons:
http://www.getfu…
What file are you seeing that error in? Also, what platform? The fuel_helper which contains the fuel_nav function should be autoloaded and be available.
There are 2 areas to look at:
The first place is in the Base_module_model::form_fields() method around line 434 of the fuel/modules/fuel/models/base_module_model.php file is most. It basically looks for any field that ends in "_img" or "_image" and…
You will most likely need to make multiple calls.
Have you read the documentation for MY_Model:
http://www.getfuelcms.com/user_guide/libraries/my_model
http://www.getfuelcms.com/user_guide/libraries/my_model/table_class_functions
In particular you…
Is there a reason why you news_item_image was changed to a file upload file type instead of a normal text field? By default, FUEL will add the ... OR upload an image file field (because it ends with "_image"). If you are wanting to change the upload…
Have you looked at the Navigation module?
http://www.getfuelcms.com/user_guide/modules/fuel/navigation
http://www.getfuelcms.com/blog/2010/12/12/learning-fuel-cms-part-2
When you upload images in the admin, the default module controller that is used to process the request (fuel/modules/fuel/controllers/module.php), looks for the upload path parameter and will save the file to that location. If you are doing it on th…
You need to have it set to "auto" so that it will access the database. If it is set to just "view" then it won't attempt to grab any variables from the database.
I'm not quite sure I understand the issue but will see if I can help you understand what may be going on.
If your model has a field ending with "_image" or "_img" then the base_module_model::form_fields() method (which is what your model most like…
Unfortunately, there is not a way to associate users with turning off global validation errors so I think your best bet would be to create your own function that generates the errors.