Using php Interfaces with CI ? |
[eluser]dreamynsx[/eluser]
Hi, I would like to make use of Interfaces in CI. How would the class loading work to make sure my base implemention class can seethe interface class. for example, i define the following classes/files and put them under CI's libraries folder. Code: // AnimalInf.php Code: // Dog.php Code: // GermanShepard.php I tried this but it could not see the AnimalInf class.
[eluser]ejangi[/eluser]
Wouldn't you need to implement "Animal"? Not "AnimalInf"?
[eluser]dreamynsx[/eluser]
Actually I would implement AnimalInf because I just changed the class name =). THanks though. However, that is besides the original question.
[eluser]ejangi[/eluser]
Sorry, I missed the important sentence in your post... I imagine you would need to amend GermanShepard.php to include the other classes: Code: include(realpath(__FILE__).'/Dog.php'); And then you would just load the GermanShepard library like any other CI library. |
Welcome Guest, Not a member yet? Register Sign In |