如何在Laravel中的自定义配置文件中重用现有的数组值?

时间:2013-06-11 18:17:17

标签: php laravel

假设我在“config / custom.php”中有以下数组

return array(
    'svn_host' => "https://MYSERVERNAME",
    'svn_user' => "deployment",
);

现在假设我添加了另一个值,但我想重用同一个数组中的现有值。

return array(
    'svn_host' => "https://MYSERVERNAME",
    'svn_user' => "deployment",
    'cmd' => "svn ls --username [I want to use 'svn_user' here]"
);

1 个答案:

答案 0 :(得分:0)

上面给它一个变量......它是一个黑客,但它会起作用

$user = "deployement";
return array(
'svn_host' => "https://MYSERVERNAME",
'svn_user' => $user,
'cmd' => "svn ls --username ".$user
);