-
Notifications
You must be signed in to change notification settings - Fork 2
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
Readme and container calling #1
base: master
Are you sure you want to change the base?
Conversation
Thanks for the PR! I have to test whether the explicit 'navigation' container name still works in our case. If so, I'll merge it soon. |
@adamculp I have tested it now. It seems when I inject the navigation manually (which is the case with ensemble, our cms) the explicit My suggestion: create a ModuleOptions class which contains a "navigation_key" (or so) option. Can be set in the config files (namespaced This makes it possible to create a sitemap of any navigation structure, and leaving it If you don't have the time or understand what I mean, I'll make a proposal for you. |
I see the difference, I think. The method I used was to add a 'navigation' container through the Application module.config.php and naming the array. (As found in the Quick Start http://framework.zend.com/manual/2.2/en/modules/zend.navigation.quick-start.html) Since I started with Navigation in mind and not merely a sitemap. It seems the method you are using is building a container to use as ModuleOptions class, though it was not covered in your documentation. So, I guess the question is...which method should we use for this project. (I see more flexibility with the method I used because it allows multiple containers with different names, so different menu navigation can be created within one application. Please advise. |
Adam, I think you misunderstood me :) What I meant in the view script, I'd rather have a single line changed. It was (before your PR) this:
You made it this:
I am now suggesting this:
Where
So you have a configuration which might look like this:
This allows you to have much more flexibility over what container you want to display. I can imagine we'll get options for |
Ah, I see it now. Thanks for explaining. I will implement the change and add to the PR. One thing I'm still unclear on. In looking more closely I am not sure this would be a good option. (Please let me know if I am still missing something.) How will $options be injected to the SitemapController? |
I updated previous comment. |
Good questions :) I have some examples for you:
As I said, I can do this too, but it would be great if you are willing to help! |
Thanks for the notes, and patience to help me while I learn ZF2. I will review what you wrote. |
The general idea here I'd like to follow is to inject the options into the controller (as you already pointed out). In order to achieve this, you cannot use the controller as invokable, but you must use a factory. The same holds for the options class. The options must be configured with a config from the service manager, so you need a factory for that one too. You glue it all together with the service manager to create the object graph. If you have any questions, just ask me :) |
Yes, it has been awhile. Got very busy and forgot about it. I will review and let you know. |
Adam, no problem :) I forgot it as well and as I got the other issues, I stumbled upon this one again :( |
Updates to Readme to be more basic for beginning users, and also updated templates to call the container name for navigation array from the config.