Allow add namespace to views#892
Open
thewebartisan7 wants to merge 5 commits into
Open
Conversation
Contributor
Author
|
I have several other changes to handle this, in case you are interested, I can add here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I wanted to generate all code inside a package and this work perfectly fine by just changing path and namespace in configuration of laravel_generator.php
However, the only things that can't be changed is view namespace.
With this change it's possible to add views prefix namespace, so that views are added and load from a package.
In config just add namespace prefix like so:
Where mypackage is namespace when a new path is added from package using:
There should not be any BC, nor new configuration. Just a simple check if prefixes.view has "::" and if so storing namespace separately from view path.
Then in GeneratorConfig the dynamic variable$VIEW_PREFIX$ is replaced with namespace if set.
The same for ViewGenerator for selectTable fields.
I do test with several commands, but not sure if all cases are covered.
If I discover something else regarding generating code inside package, I will advise.
Of course is important to change also all laravel_generator.path and laravel_generator.namespace in config, especially the path.view.
Thanks for merging !