Welcome Guest, Not a member yet? Register   Sign In
MVC Style Question... put data in view vs controller
#4

[eluser]oldblueday[/eluser]
I solved the problem by doing two things:

1. Moving that procedure into a helper function (I'm not sure this made a difference, but it at least got it out of the view
2. Realized that $this does not exist in my helper function & possibly my in-line function, so I had to get an instance of the codeigniter superobject first... then it worked.

Just putting this up here in case someone has a similar problem:

Code:
function print_scenario_question($question, &$ak)
    {
        $CI =& get_instance();
        $CI->load->library('quizmaker');
                
        $q = $CI->quizmaker->generate_question($question);  
        $HTML_question =  "<li>" . $q['HTML_question'] . "</li>";
        $ak[] = $q['answer_key'];
        return $HTML_question;
    }


Messages In This Thread
MVC Style Question... put data in view vs controller - by El Forum - 08-16-2010, 11:24 PM
MVC Style Question... put data in view vs controller - by El Forum - 08-17-2010, 12:17 AM
MVC Style Question... put data in view vs controller - by El Forum - 08-17-2010, 01:38 AM
MVC Style Question... put data in view vs controller - by El Forum - 08-18-2010, 09:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB