我正在编写一个应用程序,允许用户修改和更改他们的一些网站设置。我只是在构建一个表单生成器,它将向各种插件发送各种选项以生成代码我想知道我是否应该为此使用对象而不是多维数组?如果是这样,我将如何更改我的代码?
所以现在我做了这个——它很长而且会变得更长,所以为了简洁起见,我只粘贴了一部分:-
$scopeSettings = array(
'site_background' => array(
'subpanels' => array(
'colour' => array(
'plugins' => array(
'colourchooser' => array(
'tip' => "The background colour appears underneath the 'Background Image' (if set)-hover over the '?' around the colour chooser for extra tips on how to use it",
'element' => 'body',
'gradientenabled' => 'true',
'opts' => array (
'closed' => 'true',
'advanced' => array(
'tip' => "You can paste in your own generated gradient codes in here",
'checkbox' => true
)//end advanced
)//end Opts
)//end colour chooser
)//end plugins
),//end colour sub panel
'pattern' => array(
'plugins' => array(
'patternselector' => array(
'tip' => "Use the pattern selector to apply effects like moire or scan lines to your background image",
'element' => 'patimg'
)//end patternselector
)//end plugins
),//end pattern sub panel
)//end subpanels
)//end site background
);//end scope settings
这种事情的最佳做法是什么?