• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling a controller from another controller

@Randy, If you read the original smalltalk80 description, Martin Fowler's paper follows on from there, it doesn't alter my understanding of MVC.

Stop editing so fast please, now I have to edit too. Tongue

[eluser]Randy Casburn[/eluser]
So let's suffice it to say the Fowler's first paragraphs were spot on...

I'll put this up here for the community's benefit. That is so everyone can see the remarkable differences between the structures and thinking necessary to go from the Passive View Pattern used by CI to the PAC/HMVC pattern you love and swear by.

And now I can finally make the point that neither - and specifically CI doesn't follow the original SmallTalk MVC pattern.

So now please take a look at this link:


This is a survey of the some of the variations of the MVC Architectural Pattern has morphed through. I would like you to take a close look at the PAC pattern which is the mother of your HMVC pattern.

Then here is a wikipedia page about HMVC and PAC...



[eluser]Mr Lazy[/eluser]
OK my original post did not intend to stir up such controversy. Anyway, what I need help with is that when a user logs onto my application, depending on their role (which is stored in the database), they get directed to a different (controller) part of the system. I can't get redirect to work (on Linux, weirdly works OK on Windows), I get the error:

Quote:Cannot modify header information - headers already sent by (output started at /home/dev/public_html/wcas/system/application/models/loginmodel.php:81)

Anybody got any good ideas how to do this?

Many Thanks,

Your header error is really more simple, look for and correct the invalid whitespace or output in your loginmodel.php somewhere before the redirect occurs.

[Edit: Michael Wales] Get back on topic - insults removed.

[eluser]Randy Casburn[/eluser]
There is only about a 17% probability that you have a whitespace problem. Let me know if wired get's lucky.


[Edit: Michael Wales] Get back on topic - insults removed.

[eluser]Colin Williams[/eluser]
Why is the model issuing a redirect, anyway? The controller should read from the model what the user's role is then decide where to go. And I don't think it makes sense to have a login model. There should me a user model that logs users in and out.

The header error is different entirely, just some things I think you should consider. A lot of people don't seem to understand the roles of Ms Vs and Cs, let alone whether or not Cs should communicate with other Cs.

@Colin, He doesnt say he's redirecting in the model, only that he has output from the model before the redirect.

[eluser]Colin Williams[/eluser]
Ahh... right you are, wired. I'd image there's a clue on or near line 81


i facing a redirection issue..need suggestions. I have developed my site in codeigniter and integrated a third party forum now both have comman headers and navigation links. Now i dont face any problem while accessing any page when within the scope of website. But when i access the forum (runs as separate app) i have links to the pages in my website..bu when i try to navigate i see blank pages...any reason ?? is it problem of scope of CI application object ..????

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.