codeigniter 4 login example
Example 1: codeigniter 4 login example
<?php namespace App\Controllers;
use CodeIgniter\Controller;
class Home extends Controller
{
public function index()
{
return render('welcome_message');
}
}
Example 2: codeigniter 4 login example
<?php namespace Config;
use CodeIgniter\Events\Events;
Events::on('post_controller_constructor', function() {
helper('render');
});
Example 3: codeigniter 4 login example
<?php
if ( ! function_exists('render'))
{
function render(string $name, array $data = [], array $options = [])
{
return view(
'layout',
[
'content' => view($name, $data, $options),
],
$options
);
}
}
Example 4: codeigniter 4 login example
<html>
<head></head>
<body>
<div class="wrap">
<?php echo $content; ?>
</div>
</body>
</html>
Example 5: codeigniter 4 login example
<?php namespace App\Controllers;
use CodeIgniter\Controller;
class Home extends Controller
{
public function index()
{
return view('welcome_message');
}
}