Outsourcing of callbacks |
[eluser]biber90[/eluser]
Hey Codeigniter Community, is it possible to outsource callbacks to a model file? Unfortunately I found no solution in the user guide: http://ellislab.com/codeigniter/user-gui...#callbacks Thank you for your help!
[eluser]titoneo[/eluser]
I think using DataMapper is an elegant solution for this because combines ORM with validation parameters (or you can only use one of both features): http://stensi.com/datamapper/pages/validation.html
[eluser]skunkbad[/eluser]
Yes, you can use a model for all of your callbacks, but you need to extend the form validation class. I do this for Community Cart, and got the code for extending the form validation class in this forum.
[eluser]biber90[/eluser]
[quote author="titoneo" date="1278483613"]I think using DataMapper is an elegant solution for this because combines ORM with validation parameters (or you can only use one of both features): http://stensi.com/datamapper/pages/validation.html[/quote] Well actually i do not want to use any extension to codeigniter. [quote author="skunkbad" date="1278491810"]Yes, you can use a model for all of your callbacks, but you need to extend the form validation class. I do this for Community Cart, and got the code for extending the form validation class in this forum.[/quote] I would really appreciate it, if you could send me the url of the post which says how to extend the form validation class.
[eluser]skunkbad[/eluser]
[quote author="biber90" date="1278530006"]I would really appreciate it, if you could send me the url of the post which says how to extend the form validation class.[/quote] I think this is it: http://ellislab.com/forums/viewthread/123780/
[eluser]biber90[/eluser]
Thank you very much skunkbad! I will try this. Hope it works. Very great forums. This thread may now be closed.
[eluser]skunkbad[/eluser]
[quote author="biber90" date="1278582348"]Thank you very much skunkbad! I will try this. Hope it works. Very great forums. This thread may now be closed.[/quote] It certainly does work. My only complaint is that without further mods you can't pass multiple values to the callbacks like you can if have a std. implementation of the form validation class in a model or controller. Somebody will probably prove me wrong, and I hope they do! ... and I don't think threads get closed here. |
Welcome Guest, Not a member yet? Register Sign In |