2011-04-18 61 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

相关问题