2011-04-18 105 views
2

我想知道可以在application.ini文件中使用的所有參數/選項。有沒有可用的清單?Zend Framework:需要application.ini的所有參數

請幫

+1

看到這個http://stackoverflow.com/questions/3136337/list-of-values-i-can-specify-in-zend-application-ini-configuration-file – 2011-04-18 20:26:05

回答

2

你可以指定任何你想要的。舉例來說,我有我的設置JavaScript文件:

js.jquery.filename = "/js/jquery.min.js" 
js.jquery.offset = 0 
js.jqueryui.filename = "/js/jquery-ui.min.js" 
js.jqueryui.offset = 1 
js.nestedsortable.filename = '/js/jquery.ui.nestedSortable.js' 
js.nestedsortable.offset = 2 
js.ckeditor.filename = "/js/ckeditor/ckeditor.js" 
js.ckeditor.offset = 3 

現在,每當我需要添加一個JavaScript文件,我做的:

$config = Zend_Registry::get('config'); 
$js = $config['js']; 
$this->view->headScript()->offsetSetFile($js['ckeditor']['offset'],$js['ckeditor']['filename']); 
$this->view->headScript()->offsetSetFile($js['jquery']['offset'],$js['jquery']['filename']); 

就像我說的,你可以指定任意值。你將經常訪問的任何東西都需要在全球範圍內可用,也許應該在那裏:)。

0

在加載配置在index.php您可以將其存儲在Zend_Registry,當你想,你可以訪問它們。

你也可以解析Zend_Config到一個數組,看看裏面是什麼。

0

@Future國王做到這一點:

$config = Zend_Registry::get('config'); 
Zend_Debug::dump($config); 

應該這樣做。讓我知道它是否有幫助。

+0

只要配置實際上保存在' Zend_Registry',可能在'Bootstrap'期間。 – 2011-04-19 00:27:42

相關問題