Best way to call controller from another controller ?

edited August 2014 in Modules
Best way to call controller::function to render /validate a form from another controller ?

Comments

  • edited 1:23AM
    It sounds like what you need is a library.

    If you refactor the code into a library, then you can call those library functions from any controller.
  • edited August 2014
    I just having same problem few days ago. Wat i did is not validate through controller but validate through model, which means i set validation rules in model, and by then i use built in sql functions like $model-〉set(), $model->save() etc. By doing this u do not need to specifically calling validation method but auto-validate will be done by model. And then u can use get_errors and add_error func to display validation result, perfectly working fine for me at this point
  • edited 1:23AM
    Validation through the model isn't a problem. Library was a quick solution.
Sign In or Register to comment.