Where should I put the behavours, filters in app-advanced directory structure?


(Blaces) #1

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




(Alexander Makarov) #2

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.