$settings array or Config Class to store project settings?

后端 未结 7 1663
眼角桃花
眼角桃花 2021-02-04 16:25

How should I store settings for project?

Which is better - to use a $settings array with all my settings:

$settings[\'max_photos\'] = 30;
//         


        
7条回答
  •  后悔当初
    2021-02-04 17:12

    If you go for the array approach, you could use array literals for slightly more readable code:

    $settings = array(
        'max_photos' => 30,
        'max_width'  => 100
        //...
    )
    

提交回复
热议问题