Yii Framework Forum: Where should I put factory classes? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Where should I put factory classes?

#1 User is offline   robawtic 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 22-August 13

Posted 12 July 2016 - 10:15 AM

Hello, so I am a bit confused as to where I should be putting these files. I am basically creating a Tournament Module outside of the basic models I have created a few classes extending a TournamentFactory class. Right now I have these files in components folder but I am not sure if this is the correct way of doing things within yii. Basically my file structure looks like this.

/components
--Bracket.php
--TournamentFactory.php
--SingleElimination.php
--DoubleElimination.php
--RoundRobin.php
--Swiss.php

/Controllers
--EventController.php
--MatchController.php
--PlayerController.php
...

/Models
--Events
--Matches
--Players
...
0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,184
  • Joined: 17-January 09
  • Location:Russia

Posted 12 July 2016 - 12:01 PM

Keep these whenever it feels good. These are not components so I'd put these and tournament type classes into "domain".
Yii 2.0 Development Cookbook

Enjoying Yii? Star us at github

Support me so I can work more on Yii: https://www.patreon.com/samdark
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users