Welcome Guest, Not a member yet? Register   Sign In
One rule for several controller
#1

hi , sorry for english, i have 10 view (every of one controller) , in every view i must load 1 file in a dropzone . When i load the file i add a record in a table  , all the table have a suffix and same text for example atleti_documenti_personali , accompagnatori_documenti_personali every table have a model . Can i add a dinamic rule for every table with only a method 


f.e 
PHP Code:
class CommonServiziRules
 
{
     

     
public function file_loaded_control($model,$id,$id_table_name)
     {

         $model = new $model();

        
$model->where($id_table_name,$id);
        

        
$num_row=$model->countAllResults();

        if (
$num_row) {

            return 
true;
        }else{

            return 
false;
        }
         
     
}


 } 


It i s possible to do ? How can i pass value from Controller ?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB