You are not logged in.
Pages: 1
Goodafternoon
I have been busy whole day studying / experimenting with zendFramwork.
Now i still have some issue:
I have build my navigation within an specific ini file (see below)
and i load that one into the application.ini with
; —
; Navigation
; —
config = APPLICATION_PATH "/configs/resources/navigation.ini"this works great but if i want to load my routes the same way it doens't seem te find mij routes :s
; —
; Routes
; —
; config = APPLICATION_PATH "/configs/resources/routes.ini"Second, i have setup an ACL and i know want to disable the logout link if you aren't logged in
and allso the profile link. i have searched on google but i could find a suited answer :s
Thnx in advance ![]()
navigation.ini
; —
; Navigation
; —
resources.view[] = ""
resources.navigation.pages.page1.label = "Home"
resources.navigation.pages.page1.module = "default"
resources.navigation.pages.page1.controller = "index"
resources.navigation.pages.page1.action = "index"
resources.navigation.pages.page2.label = "User"
resources.navigation.pages.page2.module = "default"
resources.navigation.pages.page2.controller = "user"
resources.navigation.pages.page2.action = "index"
resources.navigation.pages.page3.label = "Profile"
resources.navigation.pages.page3.module = "default"
resources.navigation.pages.page3.controller = "user"
resources.navigation.pages.page3.action = "profile"
resources.navigation.pages.page4.label = "Login"
resources.navigation.pages.page4.module = "default"
resources.navigation.pages.page4.controller = "user"
resources.navigation.pages.page4.action = "login"
resources.navigation.pages.page5.label = "Logout"
resources.navigation.pages.page5.module = "default"
resources.navigation.pages.page5.controller = "user"
resources.navigation.pages.page5.action = "logout"acl.ini
[development]
acl.roles.guest = null
acl.roles.user = guest
acl.roles.admin = user
acl.resources.allow.index.index = guest
acl.resources.allow.error.error = guest
acl.resources.allow.user.index = guest
acl.resources.allow.user.login = guest
acl.resources.allow.user.register = guest
acl.resources.allow.user.profile = user
acl.resources.allow.user.logout = user
acl.resources.allow.user.admin = adminOffline
the problem with the loaded configs is solved
you have to add them as an array
; —
; Navigation
; —
config.nav = APPLICATION_PATH "/configs/resources/navigation.ini"
; —
; Routes
; —
config.routes = APPLICATION_PATH "/configs/resources/routes.ini"Offline
In case somebody searches here:
to have the acl work on your navigation you need to define resource (and if suitable privileges) for your pages
using the example of your profile page:
resources.navigation.pages.page3.label = "Profile"
resources.navigation.pages.page3.module = "default"
resources.navigation.pages.page3.controller = "user"
resources.navigation.pages.page3.action = "profile"
resources.navigation.pages.page3.resource= "user" // matches the acl resource
resources.navigation.pages.page3.privilege = "profile" // matches the acl privilegehere is a blog series i've found helpful when learning Zend_Navigation (and integration with other components) http://www.brandonsavage.net/an-intro-t … avigation/
Offline
Pages: 1