tags:

views:

74

answers:

2

I'm making a tournament manager in CakePHP 1.3 and I have a tournament controller which is fine but I want to implement a interface that can be used to define how a tournament runs.

the controller needs to load a concrete class that implements the TournamentStyle interface that defines how the tournament works. At the end of a round the TournamentStyle is used to calculate the scores and winners and generate the next round of matches.

That gives me a .php file for the interface and other files for the various styles. My question is: where would I put these files and how would I load them into my tournament controller?

+2  A: 

You can throw the interface into app/vendors and use App::import() to load it.

webbiedave
Can you load a directory using import?
Affian
No but you can load the files in the directory. require() and include() are also incapable of loading a directory.
Mark Story
A: 

I would put those files in either app/libs or app/vendors depending on where you feel like putting them. Both libs and vendors can have files loaded with App::import(). You could also use plain old include.

Mark Story