-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix config trait file bad format #98
Fix config trait file bad format #98
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #98 +/- ##
=============================================
+ Coverage 99.43% 99.43% +<.01%
- Complexity 301 302 +1
=============================================
Files 14 14
Lines 705 710 +5
=============================================
+ Hits 701 706 +5
Misses 4 4
Continue to review full report at Codecov.
|
|
||
if you need an element that is declared inside an array you can use a special syntax : | ||
|
||
$object->getConfig('level1_array/level2_array/element_key','if not defined use this as default'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we should also provide a good guideline on how 3rd party add-ons should use their class as a top level element key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Translator implementation for sure will need it and can be created as an addon.
At this moment the TranslatableTrait return translations already written in codebase, using an addon we can extract all this "tokens" and define it as an addon.
I think we probably need a composer script or a console command that create the folder in the project for you when add the addon.
next thursday we can speak about how can be implemented addons when need extra config, like we have done with actions, the results was really good.
i make a draft for documentation of ConfigTrait ( ref : #87 )
in my project as i show you last week, i extensively use ConfigTrait with DefinitionTrait ( You will see it in a next PR ).
If you try to load an empty file, you will get an error and not an exception on :
https://github.com/atk4/core/blob/develop/src/ConfigTrait.php#L83
because $tempConfig is not an array, to avoid that i add a check against type array and raise exception if not.