Welcome Guest, Not a member yet? Register   Sign In
Question on best practice when depending on 2 controllers
#1

[eluser]Unknown[/eluser]
Hi everyone,

I'm new to the Code Igniter framework and MVC altogether and can't decide on the best way to do something that would respect MVC paradigm.

It's best explained with an example I suppose. My goal would be to integrate two completed controllers while keeping them independent.

Example:
First, I would like to have a Blog to handle all the functionality of a blog engine.
Second, I would like a Polling system to handle polls.

Now this is easily done following the video cast and such. But later on say I would like to integrate the polling system in the blog to rate posts or something of the like, what would be the best way to go at it? What kind of design pattern should I follow to make such integration painless and promote code reuse?

It's not recommended to simply call actions from the Polling controller from the Blog Controller as you would then be mixing two controllers for one view...but how to I get the Poll on a blog post if both modules are independent?

Thanks for the advice!
#2

[eluser]Unknown[/eluser]
Seems something like this would be an option but I'm wondering about Unit testing and such.

http://codeigniter.com/wiki/Wick/




Theme © iAndrew 2016 - Forum software by © MyBB