PHP code example of xxperez / codeigniter4modular
1. Go to this page and download the library: Download xxperez/codeigniter4modular library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
xxperez / codeigniter4modular example snippets
#--------------------------------------------------------------------
# LANGUAGE
#--------------------------------------------------------------------
app.defaultLocale = 'en'
app.supportedLocales = ['en','es','fr','de']
app.negotiateLocale = true
app.appTimezone = 'America/Chicago'
public $psr4 = [
APP_NAMESPACE => APPPATH, // For custom app namespace
'Config' => APPPATH . 'Config',
APP_NAMESPACE.'\Controllers' => APPPATH.'Controllers',
'Dashboard' => APPPATH . '../Modules\Dashboard' ,
'Users' => APPPATH . '../Modules\Users' ,
];
public $aliases = [
'csrf' => \CodeIgniter\Filters\CSRF::class,
'toolbar' => \CodeIgniter\Filters\DebugToolbar::class,
'honeypot' => \CodeIgniter\Filters\Honeypot::class,
'auth' => \Users\Filters\AuthFilter::class,
'noauth' => \Users\Filters\NoAuthFilter::class,
];
public $ruleSets = [
\CodeIgniter\Validation\Rules::class,
\CodeIgniter\Validation\FormatRules::class,
\CodeIgniter\Validation\FileRules::class,
\CodeIgniter\Validation\CreditCardRules::class,
\Users\Validation\UserRules::class,
];
$request = \Config\Services::request();
$validation = \Config\Services::validation();
$validation->setRules($rules, $errors);
$validation->withRequest($request)->run();
$validationErrors = $validation->getErrors();
sh
php spark module:create Customers