docs: update sample code

This commit is contained in:
kenjis 2023-03-11 09:51:32 +09:00
parent 5ecf70dae5
commit e7fe68e554
No known key found for this signature in database
GPG Key ID: BD254878922AF198
4 changed files with 29 additions and 8 deletions

View File

@ -67,6 +67,7 @@ You may change this namespace by editing the **app/Config/Constants.php** file a
new namespace value under the ``APP_NAMESPACE`` setting:
.. literalinclude:: autoloader/002.php
:lines: 2-
You will need to modify any existing files that are referencing the current namespace.

View File

@ -1,6 +1,16 @@
<?php
$psr4 = [
'App' => APPPATH,
'CodeIgniter' => SYSTEMPATH,
];
namespace Config;
use CodeIgniter\Config\AutoloadConfig;
class Autoload extends AutoloadConfig
{
// ...
public $psr4 = [
APP_NAMESPACE => APPPATH, // For custom app namespace
'Config' => APPPATH . 'Config',
];
// ...
}

View File

@ -1,3 +1,3 @@
<?php
define('APP_NAMESPACE', 'App');
defined('APP_NAMESPACE') || define('APP_NAMESPACE', 'App');

View File

@ -1,5 +1,15 @@
<?php
$classmap = [
'Markdown' => APPPATH . 'third_party/markdown.php',
];
namespace Config;
use CodeIgniter\Config\AutoloadConfig;
class Autoload extends AutoloadConfig
{
// ...
public $classmap = [
'Markdown' => APPPATH . 'third_party/markdown.php',
];
// ...
}