私は、ユーザがサイト設定のいくつかを変更したり変更したりできるようにするアプリケーションを書いています。私は多次元配列ではなく多次元配列にオブジェクトを使用する必要があるかどうかを疑問視しているコードを生成するために、多様なプラグインにさまざまなオプションを送信するフォームジェネレータを構築しています。もしそうなら、どのように私のコードを変更するのですか?PHPオブジェクトまたは配列
$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
この種とベストプラクティスがどうなるか - :私はその非常に長いthis-作られ、長く得ようとしているので、今私が唯一の簡潔さのために、それの一部を貼り付けている
ものの?
実際には良いと思いますが、私はJSONが好きです...;)そして、私はPHPとjsの間でそれをやり直すことができます。 –