| sfConfig::get array problems [message #43945] |
Tue, 22 January 2008 22:17  |
ifilipov Messages: 2 Registered: January 2008 |
Junior Member |
|
|
Hey guys,
my navigation is located in app.yml
all:
navigation:
Home: index.php
About us: about.php
Events: events.php
Mailing List: mlist.php
Contact Us: feedback.php
i'm trying to put all this in array, but it doesn't work.
$nav = sfConfig::get('app_navigation');
print_r($nav);
help please?
[Updated on: Tue, 22 January 2008 22:19]
|
|
|
|
| Re: sfConfig::get array problems [message #43955 is a reply to message #43945 ] |
Wed, 23 January 2008 10:55   |
halfer Messages: 9535 Registered: January 2006 Location: West Midlands, UK |
Faithful Member |
|
|
I believe to collapse things down to an array, you can also use the dotted syntax, something like this:
all:
.settings
navigation:
Home: index.php
About us: about.php
Events: events.php
Mailing List: mlist.php
Contact Us: feedback.php
The dotted word can be anything, and is ignored by the YAML parser. Then to access it:
<?php $nav = sfConfig::get('app_navigation');
print_r($nav); ?>
(If that doesn't work, try swapping the place of ".settings" and "nagivation")
Remember Palestine
|
|
|
| Re: sfConfig::get array problems [message #56455 is a reply to message #43955 ] |
Fri, 18 July 2008 11:08  |
|
the solution that work for me is:
all:
.array:
navigation:
Home: index.php
About us: about.php
Events: events.php
Mailing List: mlist.php
Contact Us: feedback.php
<?php
$nav = sfConfig::get('app_navigation');
print_r($nav);
?>
Marc Nicolàs i Aragó
mail: marc.niko at { gmail dot com | josoc dot com }
blog: http://pastoretdelamuntanya.blogspot.com
|
|
|