Comments (8)
I'd find a common.php
much more imporant. It would reduce the amout of duplicated config a lot.
_db.php
_urls.php
common.php
console.php
messages.php
web.php
When using sub-configs they should be indicated by some convetions, ie. _
dot-notation or even a subfolder components
and/or modules
.
components.db.php
components/db.php
components.urlManager.rules.php
from yii-base-web.
@samdark I don't really favour such a change, since it's harder to find a certain piece of configuration.
I'd prefer a very minimal config for the application template.
from yii-base-web.
Use Laravel's config structure as an example:
https://github.com/laravel/laravel/tree/master/config
Combined with .env
file it is super simple to adjust config settings. I really don't like putting the actual values in the config files themselves and then doing if (YII_ENV_DEV)
everywhere..
from yii-base-web.
Yes, could be done. Would you like to send a pull request?
from yii-base-web.
What do you mean by "harder to find a certain piece of configuration"? Any example of what would be harder to find in this case?
from yii-base-web.
In the example above there's ie. the database config read into $db
, some other configs are required directly, but i18n
is part of the web.php
- there's no convention when to use require or a variable.
If I am looking for the cache configuraton I also need to look if it's also included in web and/or console. The more files you have the more logic is required to merge them. And there's currently no way to retrieve the merged configs from the application.
I'd rather prefer to split configs depending on YII_ENV
and YII_DEBUG
, than by component or module.
from yii-base-web.
We're using conventions to add -web
or -debug
to the config files, but it requires some logic to merge them: https://github.com/dmstr/phd5-app/blob/master/src/config/main.php
from yii-base-web.
everybody want a structure similar to laravel what I don't understand why don't you guys use laravel no offense it is great tool, if you are a yii user then own it I believe yii's current config structure is great and works for most cases although you have the flexibility to change how you like it.
from yii-base-web.
Related Issues (20)
- Directory Models and Forms. HOT 3
- The requested URL /yii2-app/public/site/xxx was not found on this server.
- Should I use this template to build a new app or continue to use old templates? HOT 1
- (feat) backend/ frontend setup for docs HOT 1
- integrate some js frameworks (angular, react, vue) HOT 1
- remove login and user model HOT 20
- Script to run tests HOT 1
- Installation failed HOT 4
- Rename repo to yii-base-web HOT 14
- error db (yii\db\Exception: SQLSTATE[HY000]: General error: 1096 No tables used) HOT 1
- Running app on docker cause connection timeout HOT 6
- where is the index.php file HOT 2
- Split `params.php` by environmnet section HOT 3
- Do we need to require yii-console? HOT 4
- ./vendor/bin/yii: No such file or directory HOT 5
- Question: how to configure db HOT 7
- Add default configs / config cleanup HOT 10
- Dependabot can't resolve your PHP dependency files
- Dependabot can't resolve your PHP dependency files
- Dependabot can't resolve your PHP dependency files
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 yii-base-web.