mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
docs: update sample code
This commit is contained in:
parent
5ecf70dae5
commit
e7fe68e554
@ -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.
|
||||
|
||||
|
@ -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',
|
||||
];
|
||||
|
||||
// ...
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
<?php
|
||||
|
||||
define('APP_NAMESPACE', 'App');
|
||||
defined('APP_NAMESPACE') || define('APP_NAMESPACE', 'App');
|
||||
|
@ -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',
|
||||
];
|
||||
|
||||
// ...
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user