Welcome Guest, Not a member yet? Register   Sign In
Stratergy pattern with CodeIgniter - Abstract classes
#2

[eluser]PhilTem[/eluser]
You were overwriting your $data['lessons'] array. I think within your controller it should be

Code:
$data['lessons'] = array();
$data['lessons'][] = new Seminar( 4, new TimedCostStrategy() );
$data['lessons'][] = new Lecture( 4, new FixedCostStrategy() );

yet the rest of the code looks good. Try it with these little changes and tell me if it worked.

Using "normal" PHP coding in CI is possible and CI doesn't restrict you to use it. So your code is totally right and should work, if you changed those two lines from above Wink


Messages In This Thread
Stratergy pattern with CodeIgniter - Abstract classes - by El Forum - 03-07-2012, 03:54 PM
Stratergy pattern with CodeIgniter - Abstract classes - by El Forum - 03-07-2012, 04:37 PM
Stratergy pattern with CodeIgniter - Abstract classes - by El Forum - 03-08-2012, 03:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB