Welcome Guest, Not a member yet? Register   Sign In
Two controller for one view
#1

[eluser]jis[/eluser]
how to write two controller for a single view is that possible if it possible pls giv me some examples.......
#2

[eluser]umefarooq[/eluser]
as in CI one controller is called at a time and you can call view for controller two controller for example you have called page controller you can just simply load the view

sitename.com/page/test

later you called

sitename.com/gallery/test

now you have called gallery controller now you can call you view here also
#3

[eluser]Bramme[/eluser]
I think you misunderstood jis' question, umefarooq.

However jis, like umefarooq said: CI calls one controller at a time. Therefore it is (with Vanilla CI, afaik) impossible to use two controllers to manage one view.

I would suggest placing the functionality you need from the two controllers into a library or helpers.
#4

[eluser]jis[/eluser]
ok thank you guys..as i said erliar i am a bigginer now i need to use the form validation and upload funtion from the library i wrote these as separete functio in controller how i call these in in the view page ..??
#5

[eluser]Bramme[/eluser]
As I see it, you're having problems grasping some basic OO principles. I suggest you read up on it (plenty of tutorials/good books out there!)

You're trying to puzzle one view together with multiple controller methods where it's actually the other way around: one controller method will puzzle together multiple views (like header.php, content.php and footer.php) to create a webpage.




Theme © iAndrew 2016 - Forum software by © MyBB