CodeIgniter Forums
[BR] Qual a melhor prática? - What is the best practice? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: General (https://forum.codeigniter.com/forumdisplay.php?fid=1)
+--- Forum: Regional User Groups (https://forum.codeigniter.com/forumdisplay.php?fid=25)
+--- Thread: [BR] Qual a melhor prática? - What is the best practice? (/showthread.php?tid=64471)



[BR] Qual a melhor prática? - What is the best practice? - epsnilson - 02-23-2016

Oi,
Confused Preciso inserir uma rotina que verifique se o código do "produto" existe na tabela.
Qual a melhor prática? Inserir esta rotina no Controller do Produto ou no Helper de funções genéricas? 
(desculpe, utilizei o Google tradutor Smile  )

Hi,
Must enter a routine to check if the code of the "product " exists in the table .
What is the best practice? Entering this routine the Product Controller or the generic functions Helper ?
(Sorry , I used Google translator)



RE: [BR] Qual a melhor prática? - What is the best practice? - keulu - 02-23-2016

check the form_validation's callback.

it's exactly do for that Smile


http://www.codeigniter.com/user_guide/libraries/form_validation.html#callbacks-your-own-validation-methods