-
Eloquent ORM
-
Routing
-
REST
-
Artisan
-
Migrations
-
Composer
-
Templating
-
Authentication
-
Facades
-
Mail
Read all points at http://www.websanova.com/blog/laravel/10-reasons-why-laravel-is-better-than-codeigniter
Read all points at http://www.websanova.com/blog/laravel/10-reasons-why-laravel-is-better-than-codeigniter
Opsss!
We have to load the database library!
Open your application/config/autoload.php and on $autoload[‘libraries’] add database.
Facebook’s HipHop Engine, When to Use it, and Getting it to Work with CodeIgniter
I’v recently posted an article mentioning Facebook Ion Auth, and a visitor from France asked me how did I installed it.
Please notice that you are at your own risk using this!
Please post a comment if you find any mistake, error, problem, issue, etc, etc!
Autor: Me!
These are the steps.
$autoload['libraries'] = array('database', 'ion_auth', 'Facebook_ion_auth');
nginx
Add the following lines on your /etc/nginx/sites-enable/domain.com or default.
# removes trailing "index" from all controllers if ($request_uri ~* index/?$) { rewrite ^/(.*)/index/?$ /$1 permanent; }
More details how to set up a nginx environment for CI.
http://wiki.nginx.org/Codeigniter
Apache
Create a .htaccess file on the root of your CI installation (in the same directory where you have system, application, etc).
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
Awesome tutorial about mod-rewrite / pretty links
http://stackoverflow.com/questions/20563772/reference-mod-rewrite-url-rewriting-and-pretty-links-explained
Thats kinda it!
Basically is a pretty url rewrite condition, for nginx must be also simple as that.
Simple as that!
In a startup project that i’m developing with a friend we are using CodeIgniter and Ion Auth to manage users.
We wanted users to login with their facebook accounts to make easier for them to register and login in our webapp.
We are using facebook-ion-auth from dgeorgiev. It simply works!
Tnks dgeorgiev!
On my latest work/project, with CodeIgniter, I need to use subqueries – a select inside another select.
This is a subquery library for CodeIgniter’s active record class. It lets you use active record methods to create subqueries in SQL queries. It supports SELECT, JOIN, FROM (and other statements, I guess). It also supports subqueries inside subqueries.
From: https://github.com/EllisLab/CodeIgniter/wiki/Subqueries
For that I had to download a subquery library for CodeIgniter’s available where
https://github.com/NTICompass/CodeIgniter-Subqueries.
I’v uploaded a CodeIgniter application from my localhost with Apache to a server running Nginx.
Its works perfectly on my localhost and on other server with Apache.
It’s under a subdomain, an domain and other subdomains are running PHP 100%.
This application in CI doesn’t start, and PHP is returned without being compiled.
This is what I get on /var/log/nginx/error.log:
2013/12/05 14:50:31 [error] 20139#0: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error: Class 'M_website' not found in /home/webroot/domain.com/cms/system/core/Loader.php on line 303" while reading upstream, client: 84.91.4.220, server: cms.domain.com, request: "GET /websites HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "cms.domain.com"
Why the problem?
CI files were starting with
<?
and not with
<?php
Solution
Had to edit /etc/php5/fpm/php.ini and set short_open_tag from Off to On and restart php-fpm.
service php5-fpm restart
This is how I solved it… simple issue to solve.
Simple solution for this notice… library isn’t loaded. 🙂
Message: Undefined property: Processing::$zip
In my case, this is the solution $this->load->library(‘zip’);
In a SQL with LEFT OUTER JOIN I had to sum some columns but some of them returned with NULL value and the result of it was a NULL.
So imagine that we want to add table1`.`columnA`to `table2`.`columnB`, we do something like this
SELECT *, (table1`.`columnA` + `table2`.`columnB`) AS total
and if some of them is NULL the total will be NULL.
What I had to do was this
SELECT *, (ifnull(`table1`.`columnA`,0 ) + ifnull(`table2`.`columnB`, 0)) AS total
And if you want to put it on codeigniter where is how I made it:
$this->db->select('*, (ifnull(`table1`.`columnA`,0 ) + ifnull(`table2`.`columnB`, 0)) AS total', FALSE);
Note the , FALSE, it has to be there.
$this->db->select() accepts an optional second parameter. If you set it to FALSE, CodeIgniter will not try to protect your field or table names with backticks. This is useful if you need a compound select statement.
http://ellislab.com/codeigniter/user-guide/database/active_record.html