Codeigniter 3 upper(ucwords) first letter of filename for libraries,controllers,models

Codeigniter 3 upper(ucwords) first letter of filename  for libraries,controllers,models

In this page updating PHP filename for "codeigniter version 3" explained

Starting with CodeIgniter 3.0, all class filenames (libraries, drivers, controllers and models) must be named in a Ucfirst-like manner or in other words - they must start with a capital letter

 

 


31/10/2017

Solving Codeigniter Ico File Is Not Allowed Error

go to  config/mimes.php add following to array

 

'ico'=>array('image/vnd.microsoft.icon''image/ico''image/icon''text/ico''application/ico''image/x-icon')


03/12/2015

codeigniter array_column

http://www.php.net/manual/en/function.array-column.php

$first_names = array_column($records, 'first_name');

[php]

<!--?php <br ?-->// Array representing a possible record set returned from a database
$records = array(
array(
'id' => 2135,
'first_name' => 'John',
'last_name' => 'Doe',
),
array(
'id' => 3245,
'first_name' => 'Sally',
'last_name' => 'Smith',
),
array(
'id' => 5342,
'first_name' => 'Jane',
'last_name' => 'Jones',
),
array(
'id' => 5623,
'first_name' => 'Peter',
'last_name' => 'Doe',
)
);

$first_names = array_column($records, 'first_name');
print_r($first_names);
?>
Array
(
    [0] => John
    [1] => Sally
    [2] => Jane
    [3] => Peter
)

<!--?php
// Using the $records array from Example #1
$last_names = array_column($records, 'last_name', 'id');
print_r($last_names);
?-->

Array
(
    [2135] => Doe
    [3245] => Smith
    [5342] => Jones
    [5623] => Doe
)
[/php]
										

14/01/2015

Codeigniter Sending Email With smtp using google gmail smtp

Codeigniter Sending Email With smtp [php] function index() { $config = Array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.googlemail.com', 'smtp_port' => 465, 'smtp_user' => 'my mail', 'smtp_pass' => 'my password', 'mailtype' => 'html', 'charset' => 'iso-8859-1' ); $this->load->library('email', $config); $this->email->set_newline("\r\n"); <!--more--> $this->email->from('aaa@gmail.com', 'aaa'); $this->email->to('bbb@gmail.com'); $this->email->subject('This is an email test'); $this->email->message('It is working. Great!'); $result = $this->email->send(); echo $this->email->print_debugger(); } [/php] Sending Email in a loop [php] $list =array( "my name 1"=>"example1@example.dd", "my name2"=>"example2@example.dd", "my name 3"=>"example3@example.dd" ); foreach ($list as $name => $address) { $this->email->clear(); $this->email->to($address); $this->email->from('your@example.com'); $this->email->subject('Here is your info '.$name); $this->email->message('Hi '.$name.' Here is the info you requested.'); $this->email->send(); } [/php]

14/01/2015

codeigniter customizing pagination


$config['full_tag_open'] = '<p>';
$config['full_tag_close'] = '</p>';
$config['cur_tag_open'] = '<b>';
$config['cur_tag_close'] = '</b>';
$config['first_link'] = ' First';
$config['last_link'] = ' Last';
$config['last_tag_open'] = '<p>';
$config['last_tag_close'] = '</p>';
$config['next_link'] = '';
$config['next_tag_open'] = '<p id="nextbutton" style="padding-left:5px;">';
$config['next_tag_close'] = '</p>';
$config['prev_link'] = '';
$config['prev_tag_open'] = '<p id="prevbutton" style="padding-right:5px;">';
$config['prev_tag_close'] = '</p>';


14/01/2015