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

2.5 KiB

Alternate Snippets for View Files

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

Command Description Output
ci4:views:endSection Make end Section in View files
<?= $this->endSection() ;?>
ci4:views:extend Using Layouts in Views
<?= $this->extend('layouts') ;?>
ci4:views:foreach Make foreach in View files
<?php foreach ($items as $item) : ?>
  <li><?= $item ?></li>
<?php endforeach ?>
ci4:views:if Make if in View files
<?php if (condition) : ?>
<!-- TRUE -->
<?php endif ?>
ci4:views:if-else Make if else in View files
<?php if (condition) : ?>
<!-- TRUE -->
<?php else : ?>
<!-- FALSE -->
<?php endif ?>
ci4:views:if-elseif Make if elseif in View files
<?php if (condition) : ?>
<!-- TRUE -->
<?php elseif (condition) : ?>
<!-- FALSE -->
<?php endif ?>
ci4:views:if-elseif-else Make if elseif else in View files
<?php if (condition) : ?>
<!-- TRUE 1 -->
<?php elseif (condition) : ?>
<!-- TRUE 2 -->
<?php else : ?>
<!-- FALSE -->
<?php endif ?>
ci4:views:include Including View Partials
<?= $this->include('sidebar') ;?>
ci4:views:php Make php tag in View files
<?php code ;?>
ci4:views:php-echo Make php echo tag in View files
<?= code ;?>
ci4:views:renderSection Make render Section in View files
<?= $this->renderSection('content') ;?>
ci4:views:section Make Section in View files
<?= $this->section('content') ;?>
ci4:views:section-endSection Make Section with end Section in View files
<?= $this->section('content') ;?>
<!-- CODE HERE -->
<?= $this->endSection() ;?>