Comments (5)
My personal approach: keep controller, models and views close together. General Models in a separate folder Models.
I would like to know a recommended or standardized way as requested though.
from docs.
I imagine we can put them anywhere. But I agree some structure and keeping them together is best.
Do you seperate your business logic into folders like “Blog” and then have controllers, models and views under this directory or in subdirectories ?
from docs.
Since I have URLs like https://www.domain.tld/category/page I placed files like this:
Control
- Controller.php
- Category
- page.php (view)
- page
- AR.php
- Model.php
Models
- GenericModel.php
I'm sure it's not perfect, but works alright for me. I can always find the files fast I need to edit.
from docs.
@Mister-42 approach is alright. That should be added to yiisoft/docs.
from docs.
See yiisoft/app#238
from docs.
Related Issues (20)
- Running yii3 on subfolder with IIS 10 HOT 19
- Adopt to router changes HOT 2
- Feature: Add deploy instrument integration HOT 4
- Do not mention default values in PHPDoc HOT 1
- Consider using conventional comments for code review HOT 1
- Have rules about resolving discussions / conversations in code review HOT 4
- Chain calls must be put on separate lines HOT 14
- Add Related packages section HOT 2
- update CODE_OF_CONDUCT.md links
- update yii site links
- update links
- broken links
- Add Rule and Rule Handler to glossary
- Add common PHPStorm config
- Document explicit `null` type hint HOT 5
- Configure max line length
- Code style summary to discuss and configure HOT 4
- Automatically add line breaks for long lines in Markdown HOT 1
- Automatically detect broken links
- Link to the next chapter where it makes sense
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docs.