• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.