Skip to content
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

Add "Namespace" support #83

Merged
merged 4 commits into from
Feb 5, 2022
Merged

Add "Namespace" support #83

merged 4 commits into from
Feb 5, 2022

Conversation

jakejohns
Copy link
Member

Zend Expressive Template Interface defines support for namespaces using the :: scope resolution operator.

Personally, I've just been using paths to basically simulate some approximation of this functionality, and had previously been considering trying to add some kind of PSR-4-like directory definition that would basically just pretend a directory structure was deeper than it was, but this seems like a solution, and seems to exist elsewhere too.

Thoughts?

(On an unrelated note, and thoughts/idea on starting 3.x anytime so we can modernize some syntax and get rid of some of the old cruft?)

@jakejohns
Copy link
Member Author

I just noticed that @harikt has harikt/hkt-expressive-auraviewrenderer, but I'm not sure I understand totally how the namespace thing is implemented. It looks to me like it's just disregarded?

@harikt
Copy link
Member

harikt commented Oct 26, 2017

Hi @jakejohns ,

I am a bit sick, and have some trouble with eye. So this is quick reply. I may want to look more into what you need here.

Basically it was trying to work in the way expressive was doing.

https:/harikt/hkt-expressive-auraviewrenderer/blob/master/src/AuraViewRenderer.php#L90

addPath($path, $namespace = null)

So addPath('/templates/error', 'err') see here https:/harikt/hkt-expressive-auraviewrenderer/blob/master/src/AuraViewRendererFactory.php#L29-L41

@harikt
Copy link
Member

harikt commented Nov 2, 2017

Hey @jakejohns ,

Thanks for making the implementation. I think you have made the namespace in the core. My repo just create namespace on top of expressive renderer. Do you have any other questions ?

@harikt
Copy link
Member

harikt commented Nov 2, 2017

I have merged #80 . If you merge those changes the unit tests will pass on 7.x I believe.

@harikt
Copy link
Member

harikt commented Nov 18, 2017

Thank you.

This looks good to me.

@pmjones do you have any thoughts ? Else I can merge this and make a release.

@harikt
Copy link
Member

harikt commented Nov 29, 2017

Hey @jakejohns ,

can you add some documentation to this.

I will merge once you are done, do ping me so I don't miss it.

@jakejohns
Copy link
Member Author

@harikt how's this?

Copy link
Member

@harikt harikt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good.

Question : Do you think we can add a way to set the namespace separator ?

So it may help to change the delimiter from :: to something else also if needed. That may be a rare case though.

UPDATE : May be that will over kill the template registry. Lets not worry about that now 👍 .

README.md Outdated Show resolved Hide resolved
@harikt
Copy link
Member

harikt commented Feb 5, 2022

Thank you @jakejohns .

@harikt harikt merged commit bb2117a into auraphp:2.x Feb 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants