pojokcodeid.nvim-lazy/snippets/codeigniter4/docs/CHANGE.md
2023-03-03 07:09:50 +07:00

4.1 KiB

Change Command Snippets


Alternate Snippets for View Files

[ProjectRoot]/app/Views/**.php

Command Description Output
Lates News
ci4_endsection ci4:views:endSection Make end Section
<?= $this->endSection() ;?>
ci4_extend ci4:views:extend Using Layouts in Views
<?= $this->extend('layouts') ;?>
ci4_include ci4:views:include Including View Partials
<?= $this->include('sidebar') ;?>
ci4_php ci4:views:php Make php tag
<?php code ;?>
ci4_php_echo ci4:views:php-echo Make php echo tag
<?= code ;?>
ci4_rendersection ci4:views:renderSection Make render Section
<?= $this->renderSection('content') ;?>
ci4_section ci4:views:section Make Section
<?= $this->section('content') ;?>
ci4_sectionend ci4:views:section-endSection Make Section with end Section
<?= $this->section('content') ;?>
<!-- CODE HERE -->
<?= $this->endSection() ;?>

Alternate Snippets for Routes

[ProjectRoot]/app/Config/Routes.php

Command Description Output
Lates News
ci4_routes_add ci4:routes:add Make Routes add()
$routes->add('url', 'ControllerName::index');
ci4_routes_cli ci4:routes:cli Make Command-Line only Routes
$routes->cli('migrate', 'App\Database::migrate');
ci4_routes_env ci4:routes:env Make Routes Environment
$routes->environment('development' , function($routes)
{
    $routes->add('builder','Tools\Builder::index');
});
ci4_routes_get ci4:routes:get Make Routes get()
$routes->get('url', 'ControllerName::index');
ci4_routes_group ci4:routes:group Make Routes group()
$routes->group('admin', function($routes)
{
    //Route
});
ci4_routes_group_filter ci4:routes:group-filter Make Routes group() filter
$routes->group('api' , ['filter' => 'api-auth'], function($routes)
{
    $routes->resource('url');
});
ci4_routes_group_multiple ci4:routes:group-multiple Make Routes group() multiple
$routes->group('admin', function($routes)
{
    $routes->group('users', function($routes)
    {
        //Route
    });
});
ci4_routes_group_namespace ci4:routes:group-namespace Make Routes group() namespace
$routes->group('api' , ['namespace' => 'App\API\v1'], function($routes)
{
    //Route
});
ci4_routes_post ci4:routes:post Make Routes post()
$routes->post('url', 'ControllerName::index');
ci4_routes_subdomain ci4:routes:subdomain Make Routes Limit to Subdomains
$routes->add('from', 'to', ['subdomain' => '*']);