Welcome Guest, Not a member yet? Register   Sign In
Outsourcing of callbacks
#1

[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!
#2

[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
#3

[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.
#4

[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.
#5

[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/
#6

[eluser]biber90[/eluser]
Thank you very much skunkbad!
I will try this. Hope it works. Very great forums.

This thread may now be closed.
#7

[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.




Theme © iAndrew 2016 - Forum software by © MyBB