need help with validation in administration

edited March 2013 in Modules
Hello, i am new to fuel cms. I was going through blog module. I was trying to get validation of settings page just for learning purpose.
I made following change in public $required = array('title'); in Blog_settings_model and $fields['title'] = array('required'=>TRUE); in controllers/settings.php
and i am not able to get validation done for settings page. Am i missing something?

Comments

  • edited 7:24AM
    Setting "required" => TRUE from within the form_fields method just adds the asterisk next to the field. A better approach would be to add "required" as a model property. This will both perform the validation as well as add the asterisk. The Blog_settings_model may not be a good one to try that with because it's being deprecated in the upcoming 1.0 beta in favor of the general "Settings" module, but you could try it on the blog_posts_model by adding something like "excerpt" to the model's required property.

    https://github.com/daylightstudio/FUEL-CMS/tree/1.0
    https://github.com/daylightstudio/FUEL-CMS-Blog-Module
Sign In or Register to comment.