Özel fonksiyon dönüş değeri atama ve döngüsünde kullanmak

0 Cevap php

I Smarty ile CodeIgniter çerçevesini kullanarak ve yapılandırma öğeleri döndüren bir özel Smarty işlevini kullanın ediyorum:

{ci_config name='sitemap'}

Bu çağrı returns an multidimensional array siteleri sitemap içeren:

$config['sitemap'] = array('dashboard' => array('uri'=>'dashboard',
                                                'title'=>'Dashboard'),
                           'photos' => array('uri'=>'photos',
                                             'title'=>'Photos'));

Note: this is an example array, the actual array will be really multilevel

Ben loop this array istiyorum ama nasıl use the return value in a loop I oluştururuz?

Yanlış olsa da, bu i elde etmek istiyoruz şeydir:

{foreach {ci_config name='sitemap'} as $node} 

<p>{$node.uri}</p> 

{/foreach} 

Herhangi bir öneriniz? Teşekkürler!

Note: I'm using the latest Smarty 3 RC2.

0 Cevap