Trying to implement the Stratergy Pattern with Codeigniter |
[eluser]1cookie[/eluser]
hi I'm trying implement the above pattern using this great framework but am having difficulty. From an earlier post you can see all the code. It works in native PHP so it is possible in CI - only I dont have the skills at this moment. Could anyone shed some light on this or offer a solution as CI is my framework of choice. Errors I'm recieving are: Code: A PHP Error was encountered The controller is responsible for initialising the arguments for Lesson::cost(). Code: // controller Something(s) or objects are not being instantiated at runtime me thinks... Also Code: A PHP Error was encountered ditto Code: // controller The controller should be passing this along to the view but appears to have failed for some reason... Other errors are: Code: A PHP Error was encountered In native PHP This code works: Code: <?php Is something out of sync here?
[eluser]aquary[/eluser]
Why the object creation are not the same between your native PHP and the new one... ? Code: $data['lessons'][] = new Seminar( 4, new TimedCostStrategy() );
[eluser]1cookie[/eluser]
[quote author="aquary" date="1332953124"]Why the object creation are not the same between your native PHP and the new one... ? Code: $data['lessons'][] = new Seminar( 4, new TimedCostStrategy() ); I hear what your saying. It was fealt (originally) that I was overwriting the array. However using this: Code: class Front extends CI_Controller { errors disapear, but I now have a blank white screen for output. |
Welcome Guest, Not a member yet? Register Sign In |