Cakephp 我们如何访问cake php(作为返回[elements])文件名app.php中的数组元素

Cakephp 我们如何访问cake php(作为返回[elements])文件名app.php中的数组元素,cakephp,Cakephp,] 如何检索返回数组中的变量?它在cakephp3.8版本中。驻留在cake/config/app.php中假设这是默认配置文件,首先需要在顶部包含以下文件 use Cake\Cache\Engine\FileEngine; use Cake\Database\Connection; use Cake\Database\Driver\Mysql; use Cake\Error\ExceptionRenderer; use Cake\Log\Engine\FileLog; use Cake\Mai

]


如何检索返回数组中的变量?它在cakephp3.8版本中。驻留在cake/config/app.php中

假设这是默认配置文件,首先需要在顶部包含以下文件

use Cake\Cache\Engine\FileEngine;
use Cake\Database\Connection;
use Cake\Database\Driver\Mysql;
use Cake\Error\ExceptionRenderer;
use Cake\Log\Engine\FileLog;
use Cake\Mailer\Transport\MailTransport;

return [

'App' => [
    'namespace' => 'App',
    'encoding' => env('APP_ENCODING', 'UTF-8'),
    'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'),
    'defaultTimezone' => env('APP_DEFAULT_TIMEZONE', 'UTC'),
    'base' => false,
    'dir' => 'src',
    'webroot' => 'webroot',
    'wwwRoot' => WWW_ROOT,
    //'baseUrl' => env('SCRIPT_NAME'),
    'fullBaseUrl' => false,
    'imageBaseUrl' => 'img/',
    'cssBaseUrl' => 'css/',
    'jsBaseUrl' => 'js/',
    'paths' => [
        'plugins' => [ROOT . DS . 'plugins' . DS],
        'templates' => [APP . 'Template' . DS],
        'locales' => [APP . 'Locale' . DS],
    ],
],
然后,您可以简单地阅读以下内容:

use Cake\Core\Configure;

假设这是默认配置文件,首先需要在顶部包含以下文件

use Cake\Cache\Engine\FileEngine;
use Cake\Database\Connection;
use Cake\Database\Driver\Mysql;
use Cake\Error\ExceptionRenderer;
use Cake\Log\Engine\FileLog;
use Cake\Mailer\Transport\MailTransport;

return [

'App' => [
    'namespace' => 'App',
    'encoding' => env('APP_ENCODING', 'UTF-8'),
    'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'),
    'defaultTimezone' => env('APP_DEFAULT_TIMEZONE', 'UTC'),
    'base' => false,
    'dir' => 'src',
    'webroot' => 'webroot',
    'wwwRoot' => WWW_ROOT,
    //'baseUrl' => env('SCRIPT_NAME'),
    'fullBaseUrl' => false,
    'imageBaseUrl' => 'img/',
    'cssBaseUrl' => 'css/',
    'jsBaseUrl' => 'js/',
    'paths' => [
        'plugins' => [ROOT . DS . 'plugins' . DS],
        'templates' => [APP . 'Template' . DS],
        'locales' => [APP . 'Locale' . DS],
    ],
],
然后,您可以简单地阅读以下内容:

use Cake\Core\Configure;

谢谢你。但仍然存在错误..“如果您试图访问插件控制器,请确保将其添加到您的composer文件中,或者使用插件的自动加载选项。”请在尝试访问的位置共享代码。这看起来是另一个错误。谢谢。但仍然存在错误..“如果您试图访问插件控制器,请确保将其添加到您的composer文件中,或者使用插件的自动加载选项。”请在尝试访问的位置共享代码。这看起来是另一个错误。