assets and how to make filed required?

edited March 2012 in Modules
I try to modify "fuel/assets/create"

link: http://shrani.si/f/q/KB/1FitHobF/untitled.png

I changed assets_model.php file and in function form_fields($values = array()) I add 'required' => TRUE for fields $fields['asset_folder'] and $fields['userfile']. How to make that if this two fields are empty message will be diplayed? What i must do. I try to make this two field 'required'

Comments

  • edited 2:18AM
    The asset model is quite a bit different then the other models because it doesn't use the database and instead uses the file system (it extends the CI_Model class instead of the normal Base_module_model). Because of this, the required property doesn't exist on the assets_model so you will need to make changes to the actual assets controller to do the extra validation (fuel/modules/fuel/controllers/assets.php).
  • edited March 2012
    Thank you. I modify assets.php and model and now works. Thx for helping!
Sign In or Register to comment.