Library CodeIgniter Sebuah catatan...

Card image cap

Variabel global

Gunakan $this->namaVariabel=type data, dengan akses $this->namaVariabel, untuk membuatnya global dalam satu class, tempatkan deklarasi variabel dalam function _construct.

Read More →
Card image cap

Error Session Setting

Error seperti dibawah ini merupakan error dimana path penyimpanan session bernilai NULL :

A PHP Error was encountered

Severity: Warning

Message: mkdir(): Invalid path

Filename: drivers/Session_files_driver.php

Line Number: 118

Solusinya, buka file config.php pada folder config, cari baris :

$config['sess_save_path'] = NULL;

Karena save path bernilai NULL, maka tidak dapat menyimpan session. Ganti line tersebut dengan :

$config['sess_save_path'] = sys_get_temp_dir();

Link solusi : https://forum.codeigniter.com/thread-65331.html

Read More →
Card image cap

Penamaan folder dan pengaruhnya dengan router

Pengalaman pribadi menamakan folder di view dengan url dari router dan kaitannya dengan controller.

Jika nama file di luar application bernama sama dengan url yang ada di router, maka sistem akan menampilkan folder tersebut instead controller dan view yang dimaksud.

Read More →
Card image cap

Set Rule untuk Form Validasi - form_validation

Berfungsi sebagai rule yang memvalidasi inputan dari form. 

set_rules($field[, $label = ''[, $rules = ''[, $errors = array()]]])

Parameter dari set_rules ini adalah :

  • Berada di sebelum syntax form_validation->run
  • $field : nama input post
  • $label : nama untuk menyebutkan input post tersebut, nama ini akan muncul pada form_errors dibagian view setelah form_validation->run di trigger
  • $rules : aturan yang mengecek input post, aturan tersebut tersedia oleh codeIgniter

Read More →
Card image cap

This code is important to a sub-folder-website CodeIgniter (2)

RewriteEngine On
RewriteBase /subdomain_name
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

Read More →
Card image cap

Run Form Validation CodeIgniter

if ($this->form_validation->run() == FALSE)
                {
                        $this->load->view('myform');
                }
                else
                {
                        $this->load->view('formsuccess');
                }

Read More →
Card image cap

This is a parent construct on codeigniter

public function __construct() { parent::__construct(); // Your own constructor code }

Read More →
Card image cap

This code is important to a sub-folder-website CodeIgniter

RewriteEngine On RewriteBase /subdomain_name RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L]

Read More →
Card image cap

Can They?

Im just testing my old codeIgniter code!!!

Read More →
Card image cap

CRUD [Part 1]

New! Here i found :
1. form_open replace an ordinary form tag html after declare 'form' on autoload->helper.
2. Also i found about form_validation and it has to be activated in autoload->libraries for helping also its need the edit at the controller.

Read More →
Card image cap

Array name = name variable

The thing i notice about array name in folder controller will be a variable name in folder view/{class}

Read More →
Card image cap

Nyoba CI yok [part 1]

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Read More →
Card image cap

Nyoba CI yok [part 2]

It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).

Read More →
Search
Side Widget