Yii Framework Forum: Where should I put the behavours, filters in app-advanced directory structure? - 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 the behavours, filters in app-advanced directory structure?

#1 User is offline   blaces 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 137
  • Joined: 06-April 12

Posted 20 February 2017 - 11:30 AM

Hi.

I use the app-advanced template.
I have some behavours and filters, but I do not know where I should put them.

In the guide I see the components directory, but in the components directory there are subdirectories which contains the related components.

Example
frontend/
  components/
    gallery/
      - GalleryComponent
      - GalleryURL
    payment/
      payment_methods/
        - paypalMethod
        - bank1Method
        - bank1Method
      - PaymentComponent

0

#2 User is offline   samdark 

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

Posted 21 February 2017 - 04:58 AM

Well, it's up to you. Technically Yii can load classes from anywhere if they follow PSR-4. Personally I'd put these either in /filters, /behaviors or /components/filters, /components/behaviors.
Yii 2.0 Development Cookbook

Enjoying Yii? Star us at github

Support me so I work on Yii fulltime: 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