Welcome Guest, Not a member yet? Register   Sign In
code organizing
#1

[eluser]brucse[/eluser]
Hi!

I have my own POPO (Plain Old PHP Object) hierarchy arranged in a directory structure, for examlple:

food(dir)---
soup(dir)--
brokkoly_soup.php(for class BrokkolySoup)
tomato_soup.php(for class TomatoSoup)
pasta(dir)--
spagetti.php(for class Spagetti)
makaroni.php(for class Makaroni)


Welcome to any suggestion, how to load it with minimal pain and use it anywhere in CI (M or V or C)

thanks:
brucse
#2

[eluser]xwero[/eluser]
MVC doesn't stop you from putting classes in subdirectories. CI has two places where you can put libraries : system/libraries and application/libraries.

For example you put your libraries in application/libraries with the same directory structure you are using you can call the spagetti class as follows
Code:
$this->load->library('food/pasta/spagetti');
#3

[eluser]johnwbaxter[/eluser]
I thought sub directories in libraries was only supported in CI 1.7?
#4

[eluser]brucse[/eluser]
$this->load->library('food/pasta/spagetti');

I have tried it. Didn't work on subdirs. That's why I started the topic. I check it again. Where do I find any version info in the code?
#5

[eluser]johnwbaxter[/eluser]
1.7 is only in svn, it hasn't been released yet as an official version as they are still adding stuff to it.

I doubt it will be too long until it's out though.

http://derekallard.com/blog/post/codeign...ubfolders/

If you want to know the version you're on you can look in the changelog.html in the userguide you downloaded as part of the CI package.
#6

[eluser]brucse[/eluser]
Thanks. I'm waiting for it. Temporary I store all pasta and soup in one dir mixed.

brucse




Theme © iAndrew 2016 - Forum software by © MyBB