views:

48

answers:

2

Hello,

I am trying to use multiple entries with Zend_Config_XML, but no luck so far. I have the following structure.

<acl>
<admin>
    <access moudle="module1" controller="controller1" action="action1">
    <access moudle="module2" controller="controller2" action="action2">
    <access moudle="module3" controller="controller3" action="action3">
</admin>
<manager>
    <access moudle="module1" controller="controller1" action="action1">
    <access moudle="module2" controller="controller2" action="action2">
    <access moudle="module3" controller="controller3" action="action3">
</manager>
</acl>

I can't even access to access entries.

Should I use other XML classes to use multiple entries?

+1  A: 

I've never used XML configs with ZF but it looks like you have a typo in your XML - the attribute name should be module, not moudle.

David Caunt
It does not matter actually. "moudle" is just an attribute. it can be anything. My question is that ZF does not parse it.
Moon
+1  A: 

The problem is that is not valid XML. You need to close the access tag:

<access moudle="module1" controller="controller1" action="action1" />

And as the other guy who's name I can't remember said, you have a typo in moudle.

nandu
My original code have closing tags. It still does not work
Moon
Works fine for me:fran@frarch:~/test$ php test.php array(3) { [0]=> array(3) { ["moudle"]=> string(7) "module1" ["controller"]=> string(11) "controller1" ["action"]=> string(7) "action1" } [1]=> array(3) { ["moudle"]=> string(7) "module2" ["controller"]=> string(11) "controller2" ["action"]=> string(7) "action2" } [2]=> array(3) { ["moudle"]=> string(7) "module3" ["controller"]=> string(11) "controller3" ["action"]=> string(7) "action3" }}
nandu