Skip to content

General Snippets

Luis Felipe Perez edited this page Jan 20, 2019 · 4 revisions

This snippets are for general purppose and not related to any class or package inside codeigniter.

Create a Controller

Trigger: cicontroller

It creates a base code for a controller. If the file was previously saved, it will take the file name for the path in the final comment at the end of the controller.

Create a Model

Trigger: cimodel

Creates a base code for a basic model.

Create a Helper

Trigger: cihelper

Creates a base code for a custom helper. You can specify the name and the params on the base documentation generated.

Create a .gitignore file

Trigger: cigitignore

This is a snippets that creates a gitignore file with some default contents:

*/config/development
*/logs/log-*.php
*/logs/!index.html
*/cache/*
*/cache/!index.html

Create a .htaccess

Trigger: cihtaccess

For apache users, this helps to create a default .htaccess file to use friendly urls.

Codeigniter PHP tag

Trigger: ciphp

This adds the first line tag used on the php files to avoid execution. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');