<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>codeigniter &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/codeigniter/</link>
	<description>Feed of posts on WordPress.com tagged "codeigniter"</description>
	<pubDate>Mon, 30 Nov 2009 23:28:16 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Menggunakan CMS atau Framework?]]></title>
<link>http://r1dh0angg0r0.wordpress.com/2009/11/30/menggunakan-cms-atau-framework/</link>
<pubDate>Mon, 30 Nov 2009 14:17:52 +0000</pubDate>
<dc:creator>Ridho Anggoro</dc:creator>
<guid>http://r1dh0angg0r0.wordpress.com/2009/11/30/menggunakan-cms-atau-framework/</guid>
<description><![CDATA[Saya termasuk orang yang mengembangkan website tanpa pernah membuatnya dari nol. Maksudnya, saya tid]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Saya termasuk orang yang mengembangkan website tanpa pernah membuatnya dari nol. Maksudnya, saya tidak membuat komponen dari website itu secara manual satu demi satu. Mulai dari arsitektur website, komponen modul, file uploader, user access, image manager, dll. Biasanya semua dilakukan dengan menggunakan <a href="http://blog.iorme.net/blog/post/tentang_model_view_controller">CMS</a> yang OpenSource, seperti <a href="http://wordpress.org/">WordPress</a> dan <a href="http://drupal.org/">Drupal</a> (jaman dulu juga termasuk PHPNuke). Biasanya memang saya melakukan modifikasi disana – sini agar website ini bisa bekerja sesuai keinginan. Umumnya akhirnya website tersebut akhirnya bisa berjalan sesuai harapan.</p>
<p>Tetapi kemudian datang masalah seperti berikut ini :</p>
<ol>
<li>Website tersebut membutuhkan galery foto dengan fasilitas slideshow.</li>
<li>Website tersebut membutuhkan katalog produk.</li>
<li>Website tersebut ingin mengimplementasikan fasilitas social network.</li>
<li>Website itu ingin menyediakan fasilitas bagi membernya untuk bisa mengupload file MP3. Dan tiap member nantinya bisa mengatur level akses terhadap file MP3 yang dia upload.</li>
<li>Website tersebut ingin mempunyai form yang terintegrasi untuk arsip wawancara.</li>
<li>dll</li>
</ol>
<p>Jika saya menggunakan CMS seperti Drupal. Mungkin hal ini masih bisa ditangani dengan ketersediaan modulnya yang sangat banyak. Atau jika memang modulnya belum tersedia, kita bisa membuat sendiri. Selain itu jika kurang puas, kita masih bisa melakukan oprek lebih dalam dengan menggunakan <a href="http://en.wikipedia.org/wiki/Application_programming_interface">API</a> yang disediakan Drupal. Dengan tujuan agar website ini sesuai dengan apa yang kita inginkan.</p>
<p>Tetapi, hal ini bisa jadi merupakan masalah baru. Tentunya kadangkala hal ini bisa menjadi solusi untuk satu masalah tetapi bukan tidak jarang malah menimbulkan masalah baru. Beberapa skenario yang sering terjadi :</p>
<ol>
<li>Modul untuk <a href="http://id.wikipedia.org/wiki/Sistem_manajemen_konten">CMS</a> tersedia. Tetapi ada bagian yang tidak sesuai, bahkan mungkin ada bagian yang akhirnya malah terasa mengganggu. Misal modul e-commerce dari Drupal menyediakan begitu banyak fasilitas yang pada kenyataannya tidak saya butuhkan. Sedangkan untuk beberapa bagian justru masih belum sesuai harapan. Dan untuk bisa merubah modul ini, kita harus memahami hampir kesuluruhan struktur modul ini. Ditambah pengetahuan tentang API dari Drupal.</li>
<li>Terlalu banyak pilihan modul. Misal modul untuk upload gambar di Drupal. Secara default tidak ada. Kita masih bisa menginstal modul tambahan, sehingga nantinya <a href="http://drupal.org/project/imagepicker">upload gambar di Drupal akan semudah di WordPress</a>. Tetapi ketika sampai di tahap theming, saya menyadari bahwa field untuk gambar hasil upload modul tersebut tidak bisa diakse langsung. Berbeda dengan image yang diupload menggunakan bantuan module <a href="http://drupal.org/project/imagefield">Image Field (CCK)</a>.</li>
<li>Dengan <a href="http://api.drupal.org/">API</a> yang disediakan, kadangkala kita masih membutuhkan pengetahuan tentang API lain. Dan pada akhirnya mau tidak mau saya harus mempelajari banyak API, hanya untuk mengetahui bagian mana dari API ini yang tepat untuk solusi masalah saya.</li>
<li>Salah satu hal yang paling sulit adalah merubah alur kerja dari website ini. Misal jika user ingin register, tidaklah langsung ditampilkan ke halaman register, tetapi harus melalui satu halaman polling terlebih dahulu. Untuk bisa mengimplementasikan ini, secara tidak langsung kita harus tahu alur kerja (workflow) dari CMS yang kita gunakan.</li>
<li>Butuh field yang custom untuk tiap post (tidak hanya field TITLE dan POST saja). Secara default WordPress menyediakan fasilitas Custom Fields, tetapi penggunaannya masih belum senyaman CCK di Drupal. Untuk itu harus dibuat modul sendiri.</li>
<li>dll</li>
</ol>
<p>Jika memang akhirnya saya ingin menjadi <a href="http://lullabot.com/">ahli dari CMS</a> tersebut, saya rasa tidak masalah untuk mengikuti solusi yang saya berikan di atas. Tetapi jika saya hanya ingin menggunakan CMS ini sebagai bantuan, sepertinya effort nya terlalu besar.</p>
<p>Bahkan tidak jarang saya merasa, ketika mempelajari semua API, hook, templating, konvensi, dll dari suatu CMS, effortnya mungkin sama besarnya dengan jika saya membangun website tersebut dari nol.</p>
<p>Jadi apakah akhirnya membuat CMS dari nol?</p>
<p>Tidak. Bagi saya tetap tidak. Karena ada beberapa kemudahan di CMS yang tidak saya dapatkan jika saya harus membangun dari nol. Saya harus membangun kerangka / arsitektur dari website tersebut. Dan cukup banyak pula waktu yang tersita untuk membangunnya.</p>
<p>Jadi apa solusinya?</p>
<p>Framework. Bagi saya solusi di tengah – tengahnya adalah framework. Framework menjadi solusi yang tepat jika saya ingin mengembangkan website yang berbasis konten, tetapi dengan beberapa fasilitas yang tidak umum (seperti kasus di atas tadi). Dengan framework yang tepat, saya bisa membuat API saya sendiri, tetap mendapatkan fasilitas templating secara default, fasilitas layering untuk database, dan salah satu yang paling saya sukai adalah fasilitas URL Friendly secara default. Saya tidak tahu apakah semua framework menyediakan fasilitas tersebut, tetapi yang jelas Framework yang saya pakai (CodeIgniter) menggunakannya.</p>
<p>Pilihan framework yang cukup terkenal :</p>
<ol>
<li><a href="http://www.pradosoft.com/">Prado</a> – PHP (contoh : <a href="http://www.ui.edu/">website Univertias Indonesia</a>) : Kalau tidak salah ini seperti menjadi ASP.Net pada PHP</li>
<li><a href="http://codeigniter.com/">CodeIgniter</a> –  PHP(contoh : <a href="http://okezone.com/">OkeZone.com</a>), Jujur saja, saya tahu CodeIgniter dari situs OkeZone ini, dan sampai saat ini paling nyaman menggunakan ini, karena framework ini terdokumentasi dengan baik.</li>
<li><a href="http://www.rubyonrails.org/">Ruby On Rails</a> – Ruby (contoh : <a href="http://sharingfoto.com/">SharingFoto.com</a>) : Situs ini diklaim sebagai web aplikasi pertama di Indonesia yang menggunakan Ruby On Rails.</li>
<li><a href="http://cakephp.org/">CakePHP</a> – PHP (contoh : <a href="http://owncafe.com/">OwnCafe.com</a>) : Salah seorang yang sangat aktif dalam edukasi CakePHP di Indonesia adalah <a href="http://azzam.wordpress.com/">Sunu Wibirama</a> (alumni Teknik Elektro UGM). Situs lokal cake-php bisa dilihat di <a href="http://idcake.web.id/">idcake.web.id</a></li>
<li><a href="http://www.symfony-project.org/">Symfony</a> (PHP), <a href="http://www.djangoproject.com/">Django</a> (Python), dll</li>
</ol>
<p>Saya sendiri masih penasaran dan menantikan Mambo CMS versi 5.0 yang akan menggunakan CakePHP sebagai basisnya. Dengan kondisi seperti itu, maka level kustomisasi bisa dilakukan dari tingkat yang paling dasar (langsung menggunakan framework),di lapis tengah (modul), maupun lapis akhir (theming).</p>
<p>Jika ada yang tertarik dengan framework – framework di atas, jangan lupa pahami satu istilah ini : <a href="http://www.id-joomla.com/content/view/182/41/">MVC (Model View Controller)</a></p>
<p>&#160;</p>
<p>source: <a title="http://okto.silaban.net/2008/02/website/menggunakan-cms-atau-framework/" href="http://okto.silaban.net/2008/02/website/menggunakan-cms-atau-framework/" target="_blank">http://okto.silaban.net/2008/02/website/menggunakan-cms-atau-framework/</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Koleksi lama]]></title>
<link>http://kelaskakap.wordpress.com/2009/11/29/koleksi-lama/</link>
<pubDate>Sun, 29 Nov 2009 12:59:26 +0000</pubDate>
<dc:creator>kakap</dc:creator>
<guid>http://kelaskakap.wordpress.com/2009/11/29/koleksi-lama/</guid>
<description><![CDATA[ini, koleksi lama saya. Silahkan diDownload.. Beberapa ebook tentang Adsense..http://www.4shared.com]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>ini, koleksi lama saya. Silahkan diDownload..</p>
<p>Beberapa ebook tentang Adsense..<br /><a target="_blank" href="http://www.4shared.com/file/100331427/114d84b5/106x.html">http://www.4shared.com/file/100331427/114d84b5/106x.html</a><br /><a target="_blank" href="http://www.4shared.com/file/74295883/87b5163d/adehendra-tingkatkan-dollar-ad.html">http://www.4shared.com/file/74295883/87b5163d/adehendra-tingkatkan-dollar-ad.html</a><br /><a target="_blank" href="http://www.4shared.com/file/73706907/c30c50b9/Blog__Google_Adsense.html">http://www.4shared.com/file/73706907/c30c50b9/Blog__Google_Adsense.html</a><br /><a target="_blank" href="http://www.4shared.com/file/73709248/63e9779b/cara_menemukan_ide_untuk_tema_.html">http://www.4shared.com/file/73709248/63e9779b/cara_menemukan_ide_untuk_tema_.html</a><br /><a target="_blank" href="http://www.4shared.com/file/74295534/f2fdc906/davidodang-movabletype.html">http://www.4shared.com/file/74295534/f2fdc906/davidodang-movabletype.html</a><br /><a target="_blank" href="http://www.4shared.com/file/74295316/2a48b61a/Langkah_Gampang_Pasang_Adsense.html">http://www.4shared.com/file/74295316/2a48b61a/Langkah_Gampang_Pasang_Adsense.html</a><br /><a target="_blank" href="http://www.4shared.com/file/74294528/5aecd309/Rahasia_berbisnis_Adsense.html">http://www.4shared.com/file/74294528/5aecd309/Rahasia_berbisnis_Adsense.html</a></p>
<p>Freeware<br /><a target="_blank" href="http://www.4shared.com/file/87052604/26b1581e/firetune.html">http://www.4shared.com/file/87052604/26b1581e/firetune.html</a> =&#62; Gampang nge-Tweak Firefox.<br /><a target="_blank" href="http://www.4shared.com/file/99585485/33f42096/ka_bah.html">http://www.4shared.com/file/99585485/33f42096/ka_bah.html</a> =&#62; aplikasi ini akan menampilakan foto ka&#8217;bah yang dapat dicontrol 360 derajat menggunakan mouse/keyboard.</p>
<p>Web programming..<br /><a target="_blank" href="http://www.4shared.com/file/99589970/8608e43d/Code_Igniter_Tutorial.html">http://www.4shared.com/file/99589970/8608e43d/Code_Igniter_Tutorial.html</a><br /><a target="_blank" href="http://www.4shared.com/file/136452378/946523cb/CodeIgniter_PRO.html">http://www.4shared.com/file/136452378/946523cb/CodeIgniter_PRO.html</a><br /><a target="_blank" href="http://www.4shared.com/file/112963429/6eb2dc98/Memiliki_Blog_Canggih_dg_Modal.html">http://www.4shared.com/file/112963429/6eb2dc98/Memiliki_Blog_Canggih_dg_Modal.html</a></p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=6c1450cb-e215-8969-aad9-61e332f4a674" /></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Scaffolding feature on CodeIgniter]]></title>
<link>http://postingan.wordpress.com/2009/11/29/scaffolding-feature-on-codeigniter/</link>
<pubDate>Sun, 29 Nov 2009 09:07:20 +0000</pubDate>
<dc:creator>postingan</dc:creator>
<guid>http://postingan.wordpress.com/2009/11/29/scaffolding-feature-on-codeigniter/</guid>
<description><![CDATA[When we build a website using CodeIgniter (CI), we&#8217;ll know that CI provide some feature to hel]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>When we build a website using CodeIgniter (CI), we&#8217;ll know that CI provide some feature to help programmer to produce a good quality of website, one of the feature is &#8220;Scaffolding&#8221;. Scaffolding is the feature that we can do CRUD (Create, Read, Update and, Delete) from database easily.</p>
<p>First you must activate scaffolding feature in config/routes.php</p>
<p>// it used to activate the scaffolding feature</p>
<p>$route['scaffolding_trigger'] = &#8220;scaffolding&#8221;;</p>
<p>Then put the code below  in controller directory :</p>
<p>// Activate url helper</p>
<p>$this-&#62;load-&#62;helper(&#8216;url&#8217;);</p>
<p>//Activate form helper</p>
<p>$this-&#62;load-&#62;helper(&#8216;form&#8217;);</p>
<p>// Using scaffolding feature to add some data to employee table</p>
<p>$this-&#62;load-&#62;scaffolding(&#8216;employee&#8217;);</p>
<p>Last, open your browser and type</p>
<p>http://localhost/parkir/index.php/park/scaffolding</p>
<ul>
<li>parkir can be changed, it depends on your directory on htdoc</li>
<li>park can be changed, it depends on your name class in controller directory</li>
</ul>
<p><!--more--></p>
<ul>
<li>scaffolding used to show the feature</li>
</ul>
<p>The result is<a href="http://postingan.wordpress.com/files/2009/11/untitled1.jpg"><img class="alignnone size-full wp-image-192" title="Scaffolding Screenshot" src="http://postingan.wordpress.com/files/2009/11/untitled1.jpg" alt="" width="600" height="434" /></a></p>
<p>We can read, edit, delete, and add easily&#8230; <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[CodeIgniter :: Session Data Randomly Dissappearing]]></title>
<link>http://rickyrobinett.wordpress.com/2009/11/28/codeigniter-session-data-randomly-dissappearing/</link>
<pubDate>Sat, 28 Nov 2009 17:00:57 +0000</pubDate>
<dc:creator>rickyrobinett</dc:creator>
<guid>http://rickyrobinett.wordpress.com/2009/11/28/codeigniter-session-data-randomly-dissappearing/</guid>
<description><![CDATA[Last year I encountered an issue while supporting some code I hadn&#8217;t written. The issue was th]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Last year I encountered an issue while supporting some code I hadn&#8217;t written. The issue was that random session data was randomly disappearing. I consulted with the original author of the code who was adamant that nothing with their code would be responsible for the issue. Recently, I was revisiting the code and had a revelation. They had used the CodeIgniter session library instead of PHP native sessions. After some research I discovered that the CodeIgniter session library uses cookies and as a result limits data to 4kb. This was the cause of the issue. I switched CodeIgniter to use database storage and the issue was resolved.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Utilizando NuSOAP en CodeIgniter]]></title>
<link>http://phpsblog.wordpress.com/2009/11/27/utilizando-nusoap-en-codeigniter/</link>
<pubDate>Fri, 27 Nov 2009 22:53:00 +0000</pubDate>
<dc:creator>Agustín Villalba Casás</dc:creator>
<guid>http://phpsblog.wordpress.com/2009/11/27/utilizando-nusoap-en-codeigniter/</guid>
<description><![CDATA[Hoy quiero hablar de la inclusión de la librería PHP NuSOAP en el framework de desarrollo CodeIgnite]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="font-family:Arial,Helvetica,sans-serif;text-align:justify;">
<p style="font-family:Arial,Helvetica,sans-serif;text-align:justify;"><span style="font-size:small;">Hoy quiero hablar de la inclusión de la librería PHP NuSOAP en el framework de desarrollo CodeIgniter, dado que hace unos días me vi en la necesidad de realizar esta integración. En este artículo me centraré en la integración de la librería para consumir servicios web ofrecidos por un sitio externo a nosotros.</span></p>
<div style="font-family:Arial,Helvetica,sans-serif;text-align:justify;"><span style="font-size:small;"><br />
</span></div>
<div style="font-family:Arial,Helvetica,sans-serif;text-align:justify;"><span style="font-size:small;"><strong>1. ¿Qué es NuSOAP?</strong></span></div>
<div style="font-family:Arial,Helvetica,sans-serif;text-align:justify;"><span style="font-size:small;"><strong><br />
</strong></span></div>
<div style="font-family:Arial,Helvetica,sans-serif;text-align:justify;"><span style="font-size:small;">Pero antes echemos un vistazo a ojo de pájaro qué es y para qué sirve es librería NuSOAP. Esta utilísima librería con uso muy extendido en el desarrollo web es un kit de herramientas (ToolKit) para desarrollar Web Services bajo el lenguaje PHP. Está compuesto por una serie de clases que nos harán mucho más fácil el desarrollo de Web Services. Provee soporte para el desarrollo de clientes (aquellos que consumen los Web Services) y de servidores (aquellos que los proveen). NuSOAP está basado en SOAP 1.1, WSDL 1.1 y HTTP 1.0/1.1. Aunque no es el único, dado que existen más herramientas de este tipo, podría decirse que esta es de las mejores y por tanto, de las más utilizadas en el desarrollo web.</span></div>
<div style="font-family:Arial,Helvetica,sans-serif;text-align:justify;"><span style="font-size:small;"><br />
</span></div>
<div style="font-family:Arial,Helvetica,sans-serif;text-align:justify;"><span style="font-size:small;"><strong>2. Integrando NuSOAP en CodeIgniter</strong></span></div>
<div style="font-family:Arial,Helvetica,sans-serif;text-align:justify;"><span style="font-size:small;"><br />
</span></div>
<div style="font-family:Arial,Helvetica,sans-serif;text-align:justify;"><span style="font-size:small;">Una vez que ya sabemos qué es NuSOAP, pasamos a integrarla en nuestro framework de desarrollo. Lo primero será <a href="http://sourceforge.net/projects/nusoap/files/nusoap/0.7.3/nusoap-0.7.3.zip/download">descargarnos la librería</a>, la descomprimimos y la incluimos en el directorio system/application/libraries de nuestro framework CodeIgniter. Con esto ya tenemos todo listo para poder pasar al siguiente paso: realizar la integración.</span></div>
<div style="font-family:Arial,Helvetica,sans-serif;text-align:justify;"><span style="font-size:small;"><br />
</span></div>
<div style="font-family:Arial,Helvetica,sans-serif;text-align:justify;"><span style="font-size:small;">La forma más cómoda de integrar esta librería en CodeIgniter<strong> </strong>es creando nuestra propia &#8220;pseudo&#8221; librería de CodeIgniter la cual a su vez llama y permite el uso de la verdadera librería NuSOAP que nos hemos bajado previamente. Digo &#8220;pseudo&#8221; porque realmente lo único que haremos será una interfaz de comunicación entre los controladores de nuestra aplicación y la librería NuSOAP en sí misma. Pasamos a desarrollar nuestra propia librería CodeIgniter, para ello creamos un nuevo archivo llamado nuSoap_lib.php (o como ustedes quieran llamarlo, el nombre sólo depende de su imaginación) dentro del directorio /system/application/libraries, al mismo nivel que el directorio que contiene a la librería NuSOAP.</span></div>
<div style="font-family:Arial,Helvetica,sans-serif;text-align:justify;"><span style="font-size:small;">Dentro de nuSoap_lib.php introducimos el siguiente código:</span></div>
<pre style="text-align:justify;">&#60;?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class nuSoap_lib{function Nusoap_lib(){
    require_once(BASEPATH.'libraries/NuSOAP/lib/nusoap'.EXT);
}
?&#62;</pre>
<div style="font-family:Arial,Helvetica,sans-serif;text-align:justify;"><span style="font-size:small;">Con esto ya tenemos creada nuestra &#8220;pseudo&#8221; librería de NuSOAP, a partir de ahora ya podemos utilizarla desde nuestros controladores. Para ello hemos de introducir el siguiente código en nuestro controlador para llamar a la librería nuSoap:</span></div>
<pre style="text-align:justify;">class Client extends Controller {
    function __construct() {
        parent::Controller();
        $this-&#62;load-&#62;library("nuSoap_lib");
    }

    function index() {

        $this-&#62;nusoap_client = new soapclient("http://url.servidor.soap");

        if($this-&#62;nusoap_client-&#62;fault)
        {
             $text = 'Error: '.$this-&#62;nusoap_client-&#62;fault;
        }
        else
        {
            if ($this-&#62;nusoap_client-&#62;getError())
            {
                 $text = 'Error: '.$this-&#62;nusoap_client-&#62;getError();
            }
            else
            {
                 $row = $this-&#62;nusoap_client-&#62;call(
                          'funcionEnElServidor',
                           array(parametros)
                        );
                ...
            }
     }
}</pre>
<div style="font-family:Arial,Helvetica,sans-serif;text-align:justify;"><span style="font-size:small;">De esta forma, podremos consumir servicios SOAP desde nuestra aplicación implementada con CodeIgniter. Como ven, es bastante sencillo y muy cómodo. Una razón más para seguir utilizando este sencillo y potentísimo framework que es CodeIgniter.</span></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[PHP Framework - Siapa yang tercepat?]]></title>
<link>http://mul14.wordpress.com/2009/11/23/php-framework-siapa-yang-tercepat/</link>
<pubDate>Mon, 23 Nov 2009 11:05:25 +0000</pubDate>
<dc:creator>mul14</dc:creator>
<guid>http://mul14.wordpress.com/2009/11/23/php-framework-siapa-yang-tercepat/</guid>
<description><![CDATA[Kali ini saya membandingkan enam PHP Framework berbasis MVC (Model View Controller) yang populer. Ke]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img style="float:right;" src="http://d.yimg.com/gg/doophp/avatars/45ae52322e02e416e5d02221c5e31abdd9925032.png" alt="" /></p>
<p>Kali ini saya membandingkan enam PHP Framework berbasis MVC (Model View Controller) yang populer. Keenam framework itu adalah CakePHP, CodeIgniter, Kohana v2 dan v3, Yii, dan &#8220;new kid on the block&#8221; DooPHP. Semua menggunakan versi terbaru saat ini (2009-11-22) kecuali Yii. Berikut informasi detail mengenai versi yang di-test:<br />
- <a href="http://www.cakephp.org">Cake PHP</a> 1.2.5<br />
- <a href="http://www.codeigniter.com">Code Igniter</a> 1.7.2<br />
- <a href="http://www.kohanaphp.com">Kohana</a> 2.3.4<br />
- <a href="http://v3.kohanaphp.com">Kohana</a> 3.0.1.2<br />
- <a href="http://www.yiiframework.com">Yii</a> 1.0.10<br />
- <a href="http://www.doophp.com">Doo</a> 1.2</p>
<p>Mesin yang digunakan<br />
Acer Aspire 4520<br />
AMD Turion 64 X2 TL-58 1.9 GHz<br />
RAM 3 GiB</p>
<p>Software yang digunakan<br />
- Windows 7 Ultimate<br />
- <a href="http://httpd.apache.org">Apache</a> 2.2.12<br />
- <a href="http://id.php.net">PHP</a> 5.3</p>
<p>Hampir semua framework konfigurasi-nya tidak diubah sama sekali (kondisi default). Kecuali Cake PHP yang sudah dimatikan konfigurasi session, cache, database, log, dan debug.</p>
<p>Metode test yang digunakan mencetak tulisan &#8220;Hello World!&#8221; lalu langsung exit;.</p>
<p>Hasil yang didapat adalah nilai rata-rata dalam satuan rps (request per second). Berikut dari yang terlambat hingga yang tercepat:</p>
<blockquote><p>- CakePHP      ==&#62; 19.72 rps<br />
- CodeIgniter  ==&#62; 71.23 rps<br />
- Yii          ==&#62; 73.68 rps<br />
- Kohana v2    ==&#62; 76.31 rps<br />
- Kohana v3    ==&#62; 103.39 rps<br />
- Doo          ==&#62; 200.32 rps</p></blockquote>
<p>Terlihat Doo buatan negri tetangga adalah yang tercepat dalam test &#8220;Hello World!&#8221; ini.</p>
<p>Tapi dalam memilih suatu framework, bukan mana yang tercepat. Tapi yang paling nyaman anda gunakan sehingga mempersingkat waktu <em>developing</em> dan meningkatkan produktivitas anda.</p>
<p>Berikutnya akan ada tambahan dari PHP Framework berbasis MVC lainnya seperti <a href="http://www.symfony-project.org">Symfony</a>, <a href="http://framework.zend.com">Zend Framework</a>, dan <a href="http://adventure-php-framework.org">APF</a>, <a href="http://solarphp.com/">Solar Framework</a>. Dan agar lebih fair, semua session, cache, database, dll akan di-non aktifkan. &#8220;Hello World!&#8221; juga akan dicetak pada view, bukan pada controller lalu exit.</p>
<p>Nb: Konfigurasi module dan extension yang sedang berjalan pada Apache dan PHP tidak diikutsertakan dalam tulisan ini.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[codeigniter development]]></title>
<link>http://codeigniterdevelopers.wordpress.com/2009/11/23/codeigniter-development/</link>
<pubDate>Mon, 23 Nov 2009 08:22:40 +0000</pubDate>
<dc:creator>jeremiahbrooks22</dc:creator>
<guid>http://codeigniterdevelopers.wordpress.com/2009/11/23/codeigniter-development/</guid>
<description><![CDATA[CodeIgniter Development NetTrackers has been using CodeIgniter to develop small and large scale appl]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h3><a href="http://www.nettrackers.net/ci.php">CodeIgniter Development</a></h3>
<p>NetTrackers has been using CodeIgniter to develop small and large scale applications for the last 2 years. The biggest advantage of using CodeIgniter is that it leaves a small footprint and allows our developers to code applications rapidly in a secure environment. </p>
<p>The CodeIgniter development team at NetTrackers has gone through full life-cycle development with different project sizes. Our developers use CodeIgniter for Rapid Application Development taking full advantage of it&#8217;s MVC framework. We have used CodeIgniter to build up a large and stable codebase that our developers are comfortable using and extending upon. The advantage of working with our CodeIgniter Developers is evident in our rapid response for changes or extensions to existing code.</p>
<p>CodeIgniter allows our team to build rapidly without compromising on code effeciency and code base sizes. The basic memory foot print is relatively small and allows scaling to larger sizes. Our work with CodeIgniter has allowed us to extend it to be used with a number of external providers such as the Amazon Web Services and Javascript toolkits such as DoJo and jQuery. </p>
<p>We always challenge our knowledgebase against new technologies to develop our skills and REALLY make the most of what the web can do. Our frequent use of AJAX based solutions creates websites and services that are not just completing tasks, but actually bringing a degree of pleasure in terms of use. </p>
<p>We provide, customized CodeIgniter Programming solutions if you are looking for developers in CodeIgniter. CodeIgniter Programmers in our office will cost $10 per hour or if you want to hire on a monthly basis,you would pay $1000 per month for a minnimum of 21 days of work. We provide daily reports, access to our managers for no charges, chats over Phone, Instant Messenger and email. Mixed with our strong management skills NetTrackers delivers stable and reliable applications that are tailor cut to your custom requirements at competitive prices. <br /><a href="http://jeremiahbrooks22.sosblog.com/-b/codeigniter-programmers-b1-p1.htm">codeigniter development</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Tehnologii - Prolog]]></title>
<link>http://myuglycreature.wordpress.com/2009/11/23/tehnologii-prolog/</link>
<pubDate>Mon, 23 Nov 2009 01:48:45 +0000</pubDate>
<dc:creator>mbarbulescu</dc:creator>
<guid>http://myuglycreature.wordpress.com/2009/11/23/tehnologii-prolog/</guid>
<description><![CDATA[Primul gand pe care l-am avut cu totii in echipa a fost &#8220;in ce codam&#8221;. A fost usor sa tr]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Primul gand pe care l-am avut cu totii in echipa a fost &#8220;in ce codam&#8221;. A fost usor sa trecem prin cei cativa termeni, care ne mai trecusera pe la ureche, si sa alegem Metoda aia *usoara* prin care tot ce era desenat pe hartie si gandit, sa devina realitate&#8230; web. La fel de usor a fost sa incercam sa scriem primele linii de cod mai complicate ca sa ne dam seama ca trebuie sa si gusti inainte sa mananci. Si ca sa trecem in planul concretului ne-am gandit la 3 metode de a face paginile sa fie dinamice (adica sa integram o comunitate, sa avem pagini context sensibile) : un framework, un cms sau php de la 0.</p>
<p>La capitolul framework, am constatat ca este destul de popular codeigniter (http://www.codeigniter.com) si dupa vizionarea a exact doua tutoriale video cu tot cu incercat cod, am fost convinsi ca si noi putem sa dezvoltam un intreg website in 20 de minute (precum video-ul arata un blog gata in tot atatea minute). Problema cu un framework este dificultatea de a intelege cum lucreaza bibliotecile, ce trebuie sa incarci si ce module fac ceea ce zic ca fac. O problema cu care m-am  confruntat personal a fost o simpla logare. In primul rand nu exista modulul gata facut de autentificare ci trebuie supraincarcate anumite clase. In al doilea rand, voiam sa ma folosesc de cunostintele, de baza, de PHP, insa constatam ca pana si sesiunile sunt vazute altfel. Concluzia noastra este ca un framework se studiaza intai. Avantajul, totusi,  al unui astfel de framework este modelul MVC care personal mi s-a parut intuitiv si foarte aplicabil.</p>
<p>Frameworkul Zend a fost inca o propunere, laudat fiind si pentru ca php are module zend, insa nu am reusit sa trecem de configurarea acestuia.</p>
<p>Punctul doi in aceasta discutie, ar fi un Content Management System. Din pacate, tema aleasa nu se preteaza la o astfel de abordare. Sigur ca putem scrie module php pentru CMS, dar intervine si aici problema studierii sistemului. Am fi mers ori pe Joomla ori pe WordPress, care vin si cu un design gata facut si customizabil (mai putin la WordPress).</p>
<p>Solutia numarul 3 ne avantajaza cel mai mult, php de la 0.  Cateva minute pe w3schools si doua trei exemple de lucru cu baza de date face ca PHP sa nu para o necunoscuta. Exista mii de linii de sample code utilizabil si customizabil, apoi reutilizabil in cadrul aceluiasi proiect. Suntem obisnuiti sa codam in C, Java, Scheme, Haskel, Prolog, CLIPS chiar si Verilog, limbajul nu este o problema.  De asemenea partea de control (administratorul) nu trebuie sa fie extrem de complex, noi construim sistem, stim cum merge. Singurul dezavantaj este securitatea care s-ar putea sa ne dea batai de cap.</p>
<p>Cam atat pe partea de programare pe server.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[codeigniter developers]]></title>
<link>http://codeigniterprogrammers.wordpress.com/2009/11/15/codeigniter-developers/</link>
<pubDate>Sun, 15 Nov 2009 20:54:01 +0000</pubDate>
<dc:creator>jeremiahbrooks22</dc:creator>
<guid>http://codeigniterprogrammers.wordpress.com/2009/11/15/codeigniter-developers/</guid>
<description><![CDATA[CodeIgniter Development NetTrackers has been using CodeIgniter to program small and large scale appl]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h3><a href="http://www.nettrackers.net/ci.php">CodeIgniter Development</a></h3>
<p>NetTrackers has been using CodeIgniter to program small and large scale applications for the last 2 years. The biggest advantage of using CodeIgniter is that it leaves a small footprint and allows our programmers to code applications rapidly in a secure environment. </p>
<p>The CodeIgniter development team at NetTrackers has gone through full life-cycle development with varied project sizes. Our developers use CodeIgniter for Rapid Application Development taking full advantage of it&#8217;s MVC framework. We have used CodeIgniter to build up a large and stable codebase that our developers are comfortable using and extending upon. The advantage of working with our CodeIgniter Developers is evident in our rapid response for changes or extensions to existing code.</p>
<p>CodeIgniter allows our team to develop quickly without compromising on code effeciency and code base sizes. The basic memory foot print is relatively small and allows scaling to larger sizes. Our experience with CodeIgniter has allowed us to extend it to be used with a number of external providers such as the Amazon Web Services and Javascript toolkits such as DoJo and jQuery. </p>
<p>We constantly challenge our knowledge against new technologies to extend our skills and REALLY make the most of what the web can do. Our regular use of AJAX based solutions creates websites and services that are not just completing tasks, but actually bringing a degree of pleasure in terms of use. </p>
<p>We provide, customized CodeIgniter Programming solutions if you are looking for developers in CodeIgniter. CodeIgniter Programmers in our office will cost $10 per hour or if you want to hire on a monthly basis,you would pay $1000 per month for a minnimum of 21 days of work. We provide daily reports, access to our managers for no charges, chats over Phone, Instant Messenger and email. Mixed with our strong management skills NetTrackers delivers stable and reliable applications that are tailor cut to your custom requirements at competitive prices. <br /><a href="http://jeremiahbrooks22.easyjournal.com/entry.aspx?eid=4257649">codeigniter developers</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[CodeIgniter Untuk Pemula]]></title>
<link>http://nintendofandy.wordpress.com/2009/11/14/codeigniter-untuk-pemula/</link>
<pubDate>Sat, 14 Nov 2009 08:37:35 +0000</pubDate>
<dc:creator>nintendofandy</dc:creator>
<guid>http://nintendofandy.wordpress.com/2009/11/14/codeigniter-untuk-pemula/</guid>
<description><![CDATA[Hallo Teman-teman pemula CodeIgniter !! Saya juga seorang pemula, mari kita memulai pelajaran dasar ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hallo Teman-teman pemula CodeIgniter !!<br />
Saya juga seorang pemula, mari kita memulai pelajaran dasar CodeIgniter :</p>
<p>1. Downloadlah CI (CodeIgniter) di <a title="http://codeigniter.com/download.php" href="http://codeigniter.com/download.php">http://codeigniter.com/download.php</a> (saat tutorial ini ditulis, versi yang saya download adalah CodeIgniter_1.6.0.zip)<br />
2. Ekstraklah file CodeIgniter_1.6.0.zip di folder yang bisa diakses web<br />
3. Akses web di mana CI berada, secara default akan tampil halaman welcome.</p>
<p>Ok mari kita ganti halaman welcome dengan halaman yang kita buat sendiri :</p>
<p>1. Bukalah file routes.php di folder CodeIgniter_1.6.0/system/application/config<br />
2. Ganti $route['default_controller'] = &#8220;welcome&#8221;; dengan $route['default_controller'] = &#8220;pemula&#8221;;<br />
3. Buatlah file pemula.php di folder CodeIgniter_1.6.0/system/application/controllers/<br />
4. Isi file pemula.php seperti berikut :</p>
<pre>&#60;?php
class Pemula extends Controller {
	function Pemula()
	{
		parent::Controller();
	}
	function index()
	{
		$this-&#62;load-&#62;view('pemula_view');
	}
}
?&#62;
</pre>
<p>5. Buatlah file pemula_view.php di folder CodeIgniter_1.6.0/system/application/views<br />
6. Isi file pemula_view.php sebagai berikut :</p>
<pre>&#60;html&#62;
&#60;head&#62;
&#60;title&#62;PEMULA&#60;/title&#62;
&#60;/head&#62;
&#60;body&#62;
&#60;h1&#62;Saya benar-benar seorang pemula&#60;/h1&#62;
&#60;/body&#62;
&#60;/html&#62;
</pre>
<p>7. Akseslah folder CodeIgniter_1.6.0 dengan browser Anda, Mamamiaaaaaaa&#8230;&#8230; Anda benar-benar seorang PEMULA !!!</p>
<p>Bersambung &#8230;&#8230;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Caso "URL limpia de CodeIgniter" para Linux, SOLUCIONADO]]></title>
<link>http://comunidadcodeigniter.wordpress.com/2009/11/14/caso-url-limpia-de-codeigniter-para-linux-solucionado/</link>
<pubDate>Sat, 14 Nov 2009 02:46:15 +0000</pubDate>
<dc:creator>Emilio Campos</dc:creator>
<guid>http://comunidadcodeigniter.wordpress.com/2009/11/14/caso-url-limpia-de-codeigniter-para-linux-solucionado/</guid>
<description><![CDATA[Hoy en día, somos muchos los desarrolladores que disfrutamos de las bondades de este muy buen framew]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hoy en día, somos muchos los desarrolladores que disfrutamos de las bondades de este muy buen framework, pero siempre se ha tenido el problema para quitar esa porcion de url &#8220;index.php&#8221; de nuestros proyectos.</p>
<p>Bien, pues luego de investigar, buscar y preguntar&#8230; y demas cosas, encontre un modo de retirar ese &#8220;index.php&#8221;, el cual lo trabaje en una distro de Linux.</p>
<p>Pues comencemos:</p>
<ul>
<li>Como sabran, se necesita activar el mod_rewrite en la configuracion de nuestro servidor Apache. Pues se puede hacer manualmente accediendo al archivo de configuracion o simplemente ejecutando el siguiente comando:   <strong>sudo a2enmod rewrite</strong></li>
<li>Una vez activado el mod_rewrite, procederemos a quitar las restricciones en el archivo:  <strong>sudo gedit /etc/apache2/site-enable/000-default </strong>, donde reemplazaremos todos los &#8220;<em>AllowOverride None</em>&#8221; por &#8220;<em>AllowOverride All</em>&#8220;.</li>
<li>Una vez terminado esto, procedemos a reiniciar el servicio de Apache con: <strong>sudo /etc/init.d/apache2 restart </strong>.</li>
<li>Si al reiniciar el servicio de Apache, por casualidad les aparece mensaje como: apache2: <em>Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName</em> , no se preocupen, se soluciona agregando la siguiente linea: <em>ServerName localhost</em> en el <em>apache2.conf</em>.</li>
<li>Es hora de comprobar que en nuestro archivo de configuracion  &#8221;<em>system/application/config/config.php&#8221; , esté ya modificado la opcion del index page, de modo que quede así:  <strong><span style="font-style:normal;">$config['index_page'] = &#8220;&#8221;;</span></strong></em></li>
<li><em><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;font-style:normal;line-height:18px;font-size:12px;white-space:pre;"><span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;line-height:19px;white-space:normal;font-size:13px;">Ahora viene lo más importante, y es crear un archivo: <em>.htaccess </em>con el siguiente contenido, en la carpeta donde se encuentra nuestro proyecto, es decir donde se encuentra la carpeta <em>&#8220;system&#8221;</em>:</span></span></em></li>
</ul>
<p><strong> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ErrorDocument 404 /index.php</strong></p>
<p><strong> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;DirectoryIndex index.php.</strong></p>
<p><strong> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;IfModule mod_rewrite.c&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;RewriteEngine on<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;RewriteCond %{REQUEST_FILENAME} !-f<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;RewriteCond %{REQUEST_FILENAME} !-d<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;RewriteRule ^(.*)$ index.php/$1 [L,QSA]<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;/IfModule&#62;</strong></p>
<p>Y con esto ya tenemos podemos trabajar sin el poco querido: index.php , es decir, si nuestra url era: <em>http://localhost/proyecto/index.php/controlador</em> ahora sera simplemente <em>http://localhost/proyecto/controlador</em>.</p>
<p>Espero les haya servido este post, ya saben que cualquier consulta, pueden hacerla dejandonos un comentario, y nosotros gustosamente responderemos. Gracias.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[NewBie Codeigniter | Eps #1]]></title>
<link>http://adityahas.wordpress.com/2009/11/13/tutoria-codeigniter-eps-1/</link>
<pubDate>Fri, 13 Nov 2009 12:33:27 +0000</pubDate>
<dc:creator>adityahas</dc:creator>
<guid>http://adityahas.wordpress.com/2009/11/13/tutoria-codeigniter-eps-1/</guid>
<description><![CDATA[Hehehe&#8230; Walaupun baru mencoba, boleh kan berbagi ilmu&#8230;, bagi para expert, mohon comment-]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hehehe&#8230; Walaupun baru mencoba, boleh kan berbagi ilmu&#8230;, bagi para expert, mohon comment-nya ya apabila ada kekurangan atau kesalahan..,<span style="font-style:italic;">wong saya cm otodidak kok..</span> Nuwun&#8230;.</p>
<p><span style="font-weight:bold;">Okey,,let&#8217;s begins&#8230;</span></p>
<div class="entry">
<p style="text-align:justify;">Codeigniter merupakan salah satu dari sekian banyak framework PHP. Codeigniter sendiri dikembangkan oleh <a href="http://www.ellislab.com/" target="_blank">Rick Ellis</a>. Codeigniter dikembangkan bertujuan untuk menghasilkan sebuah framework yang dapat digunakan untuk pengembangan proyek pembuatan website secara lebih cepat dibandingkan pembuatan website secara koding manual, dengan menyediakan banyak pustaka yang dibutuhkan dalam pembuatan website, dengan antarmuka yang sederhana dan struktur logika untuk mengakses pustaka yang dibutuhkan. Codeigniter memfokuskan pada pembuatan website dengan meminimalkan pembuatan kode untuk pembuatan website.</p>
<p><!--more--></p>
<p style="text-align:left;"><strong>Kenapa Memilih Codeigniter ?</strong></p>
<p style="text-align:justify;">Telah diketahui banyak framework PHP yang bertebaran, tetapi mengapa memilih Codeigniter? Di bawah ini alasan dari pemilihan Codeigniter sebagai framework yang akan digunakan :</p>
<ol style="text-align:justify;">
<li><strong>Codeigniter gratis</strong><br />
Codeigniter dibawah lisensi Apache/BSD/style open source, sehingga kita dapat menggunakan sesuai dengan keinginan kita. Dan satu yang lebih penting lagi, <strong><em>Berkah</em>.</strong> (<em>Bukan Barang Bajakan, Inputan Yang Baik Akan Menghasilkan Output Yang Baik</em>)</li>
<li><strong>Codeigniter dapat berjalan di PHP 4 dan PHP 5</strong><br />
Codeigniter dikembangkan yang tetap kompitibel dengan PHP 5, walaupun saat ini PHP telah mencapai versi ke 5. Akan tetapi, disarankan untuk memakai PHP 5, karena memberikan keuntungan yang lebih baik dari penanganan secara objek atau berorientasi objek.</li>
<li><strong>Codeigniter ringan dan cepat</strong><br />
Codeigniter secara default meload hanya beberapa pustaks saja, tidak seperti framework lain yang meload pustaka yang lebih banyak. Sehingga ringan dan cepat dijalankan. Kita juga dapat meload pustaka secara dinamik,  sesuai dengan pustaka apa saja yang akan kita gunakan. Jadi sistem menjadi ringan dan cepat.</li>
<li><strong>Codeigniter menggunakan MVC</strong><br />
Codeigniter menggunakan motode Model View Controller (MVC), yang memisahkan antara logic / logika layer dengan presentation / tampilan layer. Sehingga tugas dapat dipecah-pecah.</li>
<li><strong>C</strong><strong>odeigniter menghasilkan clean URL</strong><br />
Codeigniter menghasilkan clean URL dan search engine friendly, yang lebih baik daripada URL dengan metode “query string”. Codeigniter menggunakan pendeketan / metode segemen URL.</li>
<li><strong>Pustaka yang lengkap</strong><br />
Codeigniter dikembangkan dengan banyak sekali pustaka yang dibutuhkan dalam pembuatan website. Seperti accessing database, sending email, form data validation, maintaining session, manipulating images, berkerja dengan XML-RPC dan lebih banyak lagi.</li>
<li style="text-align:left;"><strong>Dokumentasi yang sangat bagus</strong><br />
Salah satu ciri dari sebuah framework yang benar-benar dikembangkan adalah terdapat dokumentasi yang sangat baik. Codeigniter memiliki dokumentasi yang sangat baik, dari cara instalasi hingga penggunaan pustaka-pustaka diterangkan dalamnya.</li>
</ol>
<p>Ref :<br />
<a href="http://www.putraweb.net/">http://www.<span style="font-weight:bold;">putraweb</span>.net</a><br />
<a href="http://www.codeigniter-id.com/">http://www.<span style="font-weight:bold;">codeigniter-id</span>.com</a><br />
Re-post :<br />
<a href="http://adnantawaffani.net/2009/08/04/jatuh-hati-sama-codeigniter/">http://adnantawaffani.net/2009/08/04/jatuh-hati-sama-codeigniter/</a></p>
</div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Mengkode Jadi Lebih Mudah dengan Eclipse dan CodeIgniter]]></title>
<link>http://ahaoke.wordpress.com/2009/11/13/mengkode-jadi-lebih-mudah-dengan-eclipse-dan-codeigniter/</link>
<pubDate>Fri, 13 Nov 2009 07:39:56 +0000</pubDate>
<dc:creator>ahaoke</dc:creator>
<guid>http://ahaoke.wordpress.com/2009/11/13/mengkode-jadi-lebih-mudah-dengan-eclipse-dan-codeigniter/</guid>
<description><![CDATA[Sejak lama saya menggunakan EditPlus sebagai editor tools dalam menulis kode-kode program php. Kemud]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Sejak lama saya menggunakan <a title="EditPlus" href="http://adf.ly/pqP" target="_blank">EditPlus</a> sebagai editor tools dalam menulis kode-kode program php. Kemudian beralih ke <a href="http://adf.ly/pqR">NotePad ++</a> beberapa tahun terakhir ini. Sepanjang satu dasawarsa beberapa editor pernah saya gunakan, seperti MS FrontPage, DreamWeaver, UltraEdit dsb. Kali ini saya ingin menjajal menggunakan <a title="Eclipse PDT" href="http://adf.ly/pqT" target="_blank">Eclipse PDT</a>.</p>
<p>PDT yang saya gunakan adalah versi GanyMede (lihat tulisan saya sebelumnya tentang <a title="Tutorial Eclipse" href="http://ahaoke.wordpress.com/2009/09/18/tutorial-xampp-eclipse-pdt-xdebug-dan-subversion/" target="_self">instalasi Eclipse</a>). Baru sekitar satu tahun ini, saya menggunakan framework PHP yang bernama <a title="CodeIgniter" href="http://adf.ly/pqX" target="_blank">CodeIgniter</a>. Gunanya menggunakan framework untuk mempermudah dan mempercepat pekerjaan koding.</p>
<p>Untuk menggunakan Eclipse dan CodeIgniter ada beberapa cara yang mungkin bisa anda gunakan.</p>
<p><strong>CodeIgniter</strong></p>
<p>1. Download CodeIgniter, dan ekstrak filenya</p>
<p>2. Lalu salin/copy folder CodeIgniter ke folder baru misalnya c:\CI</p>
<p>3. Di dalam c:\CI ada folder system. Di dalam folder system ada folder application. Cut folder application lalu paste ke folder system. Kira-kira hirarkinya seperti ini:</p>
<pre>application/
	config/
	controller/
	errors/
	....
system/
	codeigniter/
	database/
	fonts/
	.....
index.php
.htaccess</pre>
<p>4. Lalu edit file index.php dengan notepad. Carilah baris $application_folder = &#8220;application&#8221;;<br />
dan ubahlah menjadi $application_folder = &#8220;../application&#8221;;</p>
<p><strong>Eclipse</strong></p>
<ol>
<li><code>Jalankan Eclipse dan buat File New PHP Project. Isi nama proyek dengan CI_CORE dan pilih Create Project from existing source. Browse dan pilih ke c:\CI\system. Folder system merupakan sumber utama kode-kode Codeigniter.</code></li>
<li>Buat lagi New Project dengan nama CI_APP, dan arahkan ke c:\CI\application. Folder ini akan berisi kode-kode proyek yang akan kita kerjakan. Kemudian kita sertakan pula Project Path untuk dimasukkan ke CI_APP, masukkan CI_CORE seperti gambar ini:</li>
</ol>
<div id="attachment_166" class="wp-caption alignnone" style="width: 483px"><img class="size-full wp-image-166" title="Eclipse Path " src="http://ahaoke.wordpress.com/files/2009/11/eclipse_path001.jpg" alt="Eclipse Path " width="473" height="189" /><p class="wp-caption-text">Masukkan CI_CORE sebagai bagian dari proyek</p></div>
<p>Hasilnya kira-kira seperti ini:</p>
<div id="attachment_167" class="wp-caption alignnone" style="width: 126px"><img class="size-full wp-image-167" title="Project View" src="http://ahaoke.wordpress.com/files/2009/11/eclipsecodeigniter_projectsview.png" alt="Project View" width="116" height="299" /><p class="wp-caption-text">Tampilan CodeIgniter dengan Eclipse</p></div>
<p>Nah ketika kita akan ketik-ketik koding di Eclipse. Kita akan dimudahkan dengan AutoCompletion seperti gambar ini:</p>
<p><img class="alignnone size-full wp-image-168" title="eclipsecodeigniter_autocompletion" src="http://ahaoke.wordpress.com/files/2009/11/eclipsecodeigniter_autocompletion.png" alt="eclipsecodeigniter_autocompletion" width="480" height="222" /></p>
<p>Semoga meng-koding jadi lebih mudah dan menyenangkan.</p>
<pre><code>
</code></pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[CodeIgniter Cheatbook...]]></title>
<link>http://rainconcert.wordpress.com/2009/11/13/codeigniter-cheatbook/</link>
<pubDate>Thu, 12 Nov 2009 18:40:16 +0000</pubDate>
<dc:creator>rainconcert</dc:creator>
<guid>http://rainconcert.wordpress.com/2009/11/13/codeigniter-cheatbook/</guid>
<description><![CDATA[Hi Coderz, Sheet-1 is a list of library functions with parameters. Sheet-2 is for helpers functions ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hi Coderz,<br />
Sheet-1 is a list of library functions with parameters.<br />
Sheet-2 is for helpers functions &#38; CodeIgniter reserved names etc.<br />
Save the images and keep it as an easy reference.<br />
<img class="alignnone size-large wp-image-34" title="codeigniter_1.7.1i_library_reference" src="http://rainconcert.wordpress.com/files/2009/11/codeigniter_1-7-1i_library_reference1.png?w=723" alt="codeigniter_1.7.1i_library_reference" width="723" height="1024" /></p>
<p><img class="alignnone size-large wp-image-36" title="codeigniter_1.7.1_helper_reference" src="http://rainconcert.wordpress.com/files/2009/11/codeigniter_1-7-1_helper_reference.png?w=723" alt="codeigniter_1.7.1_helper_reference" width="723" height="1024" /></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[10 quick CodeIgniter tips for better performance]]></title>
<link>http://rainconcert.wordpress.com/2009/11/12/10-quick-codeigniter-tips-for-better-performance/</link>
<pubDate>Thu, 12 Nov 2009 12:28:37 +0000</pubDate>
<dc:creator>rainconcert</dc:creator>
<guid>http://rainconcert.wordpress.com/2009/11/12/10-quick-codeigniter-tips-for-better-performance/</guid>
<description><![CDATA[Hi Coderz, These are some tips for increasing the performance of CodeIgniter. Please have a look. 1.]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hi Coderz,<br />
               These are some tips for increasing the performance of CodeIgniter. Please have a look.<br />
1. <strong>Move application directory outside of the system folder</strong></p>
<p>Application directory doesn’t require residing inside system directory all time.<br />
You can move this anywhere according to your convenience.<br />
So, you don’t need to dig deeper into the system directory every time to access a controller or model.</p>
<p>After moving the application directory, you can simply update the new path in “$application_folder” variable of the main index.php file. And another happy new is, if you put the application directory &#38; the system directory in a same folder, you don’t need to change anything. </p>
<p>2.<strong> Remove ‘index.php’ in the URLs using htaccess</strong></p>
<p>By default CodeIgniter includes the index.php file in your URLs. To create friendlier &#38; search engine optimized URL, remove the ‘index.php’ from your URLs using htaccess. Add the below code in an htaccess file &#38; upload to your server and it will remove the ‘index.php’ from URL.<br />
<code>RewriteEngine on<br />
RewriteCond $1 !^(index\.php&#124;images&#124;robots\.txt)<br />
RewriteRule ^(.*)$ /index.php/$1 [L]</code></p>
<p>3. <strong>Use routes.php to remap or redirect URLs</strong></p>
<p>Use regex pattern or wildcards with $route array to remap a URL to a new location.<br />
Instead creating a function for each redirection, this will help you to save time &#38; resources.</p>
<p>4. <strong>Use Autoload whenever required</strong></p>
<p>Use $autoload array to load resources (libraries, helpers, plugins etc) rather than loading in each function.<br />
If it is required for a specific controller only, then load them in the controller’s constructor method.<br />
It you use $autoload for everything, it will slow down your site &#38; affect perfomance, so use it whenever necessary. </p>
<p>5. <strong>Try to keep all configuration in the config directory</strong></p>
<p>Instead setting configuration values in each function, you can use a separate file to include all config options.<br />
For example, you can use a form_validation.php file under ‘application/config’ folder and you can keep all validation rules for the total application in a single array.<br />
In this manner you can create a separate file for every library.<br />
Initially it may take some extra time, but in the long run it will help you to save many hours.</p>
<p>6. <strong>Filter all user input before adding them to DB</strong></p>
<p>If your application heavily depends on user input, then set $config['global_xss_filtering'] = TRUE in config.php file.<br />
Don’t forget to filter &#38; escape user input for better security. </p>
<p>7. <strong>Don’t use pure PHP, if there is a CI alternative</strong></p>
<p>Before using any native PHP function or code, double check if there is any CI function is available.<br />
CI functions are created to help you to decrease your workload &#38; to increase performance.<br />
Always when you use CI, use CI functions. </p>
<p>8. <strong>Delete unnecessary libraries and helpers to save server space</strong></p>
<p>Usually, We don’t use all the libraries and helpers in every application. But keeping them in the server requires more space and cause extra cost.</p>
<p>Once we complete our development, when we move to hosting server its better to delete unused libraries &#38; helpers. It will help to reduce hosting space usage. But be careful &#38; make sure before deleting any file that it is not used anywhere. </p>
<p>9. <strong>Create a library or helper for frequently using functions</strong></p>
<p>Try to create a library or helper with all reusable functions to avoid repeated coding of the same thing over and over.<br />
For example if we need to check for user authentication, instead checking their authenticity in every function and redirecting them to login page (if the user doesn’t have permission) we can create a logincheck() function in authentication library and can simply call the function to check for permission.</p>
<p>10. <strong>Avoid .php extension when loading views</strong></p>
<p>When loading view files, avoid using .php extensions. It is not necessary to use, unless if you use different extension like .html etc. </p>
<p>And one more : Cache output files to decrease server load</p>
<p>Repeated requests to a function that returns the same results every time can cause unnecessary load on the server.<br />
It can be easily avoided by using the CoedIgniter’s cache() function.<br />
Caching all the pages has no meaning, if they are dynamic pages.<br />
If you use dynamic pages like stock ticker then there is no meaning of caching. Because its value changes every minute &#38; it can display wrong information to the users.<br />
So, use output cache wisely.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Идеальная админка сайта!]]></title>
<link>http://paganez.wordpress.com/2009/11/07/%d0%b8%d0%b4%d0%b5%d0%b0%d0%bb%d1%8c%d0%bd%d0%b0%d1%8f-%d0%b0%d0%b4%d0%bc%d0%b8%d0%bd%d0%ba%d0%b0-%d1%81%d0%b0%d0%b9%d1%82%d0%b0/</link>
<pubDate>Sat, 07 Nov 2009 14:45:12 +0000</pubDate>
<dc:creator>paganez</dc:creator>
<guid>http://paganez.wordpress.com/2009/11/07/%d0%b8%d0%b4%d0%b5%d0%b0%d0%bb%d1%8c%d0%bd%d0%b0%d1%8f-%d0%b0%d0%b4%d0%bc%d0%b8%d0%bd%d0%ba%d0%b0-%d1%81%d0%b0%d0%b9%d1%82%d0%b0/</guid>
<description><![CDATA[IB.Pro CMS Ну вот и она&#8230; Идеальная на мой взгляд! Это была середина дня. 7 ноября. Я подбирал ]]></description>
<content:encoded><![CDATA[IB.Pro CMS Ну вот и она&#8230; Идеальная на мой взгляд! Это была середина дня. 7 ноября. Я подбирал ]]></content:encoded>
</item>
<item>
<title><![CDATA[Mengizinkan semua tipe file bisa di upload pada Codeigniter]]></title>
<link>http://dillah2008.wordpress.com/2009/11/05/mengizinkan-semua-tipe-file-bisa-di-upload-pada-codeigniter/</link>
<pubDate>Thu, 05 Nov 2009 05:05:19 +0000</pubDate>
<dc:creator>dillah2008</dc:creator>
<guid>http://dillah2008.wordpress.com/2009/11/05/mengizinkan-semua-tipe-file-bisa-di-upload-pada-codeigniter/</guid>
<description><![CDATA[Pada dasarnya framework Codeigniter membuat aturan agar developer dapat memilih tipe2 file apa saja ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Pada dasarnya framework Codeigniter membuat aturan agar developer dapat memilih tipe2 file apa saja yg bisa di upload, tujuannya sangat baik <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br />Tapi dalam beberapa masalah diperlukan agar semua file bisa di upload dengan berbagai macam alasan kebutuhan.</p>
<p>Capek juga kalau harus memasukan list ekstension tersebut dalam config</p>
<blockquote><p>$config['allowed_types'] = &#8216;gif&#124;jpg&#124;png&#124;ods&#124;xls&#124;&#8230;&#124;&#8230;&#124;&#8230;&#8217;;</p>
</blockquote>
<p>Setelah dicari maka didapat salah satu teknik yg dapat menyelesaikan masalah tersebut, yaitu dengan membuka file Upload.php pada path /system/libraries . <br />Pada function is_allowed_filetype() langsung saja dibuat return nya menjadi TRUE.</p>
<blockquote><p>function is_allowed_filetype()<br /> {<br /> /*<br /> if (count($this-&#62;allowed_types) == 0)<br /> {<br /> $this-&#62;set_error(&#8216;upload_no_file_types&#8217;);<br /> return FALSE;<br /> }</p>
<p> foreach ($this-&#62;allowed_types as $val)<br /> {<br /> $mime = $this-&#62;mimes_types(strtolower($val));</p>
<p> if (is_array($mime))<br /> {<br /> if (in_array($this-&#62;file_type, $mime, TRUE))<br /> {<br /> return TRUE;<br /> }<br /> }<br /> else<br /> {<br /> if ($mime == $this-&#62;file_type)<br /> {<br /> return TRUE;<br /> }    <br /> }        <br /> }</p>
<p> return FALSE;<br /> */<br /> return TRUE; //dillah yg nambah, tadinya yang diatas&#8230;<br /> }</p>
</blockquote>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Sviluppare applicazioni per Facebook con CodeIgniter]]></title>
<link>http://leonardopellicciotta.wordpress.com/2009/11/03/sviluppare-applicazioni-per-facebook-con-codeigniter/</link>
<pubDate>Tue, 03 Nov 2009 20:56:29 +0000</pubDate>
<dc:creator>Leonardo Pellicciotta</dc:creator>
<guid>http://leonardopellicciotta.wordpress.com/2009/11/03/sviluppare-applicazioni-per-facebook-con-codeigniter/</guid>
<description><![CDATA[Ormai si sà lo sviluppo di applicazioni su facebook è diventato un MUST per molte aziende che voglio]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://leonardopellicciotta.wordpress.com/files/2009/11/logo-facebook1.jpg"><img class="size-medium wp-image-36 " title="logo facebook" src="http://leonardopellicciotta.wordpress.com/files/2009/11/logo-facebook1.jpg?w=300" alt="logo facebook" width="324" height="119" /> </a><a href="http://leonardopellicciotta.wordpress.com/files/2009/11/codeigniter_wallpaper_orange_by_nucleocide.jpg"><img class="size-medium wp-image-34" title="Code igniter logo" src="http://leonardopellicciotta.wordpress.com/files/2009/11/codeigniter_wallpaper_orange_by_nucleocide.jpg?w=300" alt="Code igniter logo" width="192" height="119" /></a></p>
<p>Ormai si sà lo sviluppo di applicazioni su facebook è diventato un MUST per molte aziende che vogliono aumentare il fatturato e la propria visibilità.</p>
<p>Un aiuto durante lo sviluppo può essere dato dal <a href="http://codeigniter.com/">Framework PHP CodeIgniter</a>. Tuttavia l&#8217;interazione tra i due sistemi (<a href="http://php.html.it/articoli/leggi/2908/la-facebook-platform-e-php/">Facebook Platform</a> e <a href="http://codeigniter.com/">CodeIgniter</a>) non è così immediata e intuitiva.</p>
<p>Ecco come fare</p>
<p><strong>Download della Facebook Platform</strong></p>
<ol>
<li>Scaricare la <a title="Scarica PHP Facebook Client Library" href="http://svn.facebook.com/svnroot/platform/clients/packages/facebook-platform.tar.gz" target="_blank">PHP Facebook Client Library</a></li>
<li>Copiare tutto il contenuto della cartella <em>/php </em>della facebook platform nella cartella <em>./system/plugins</em> di CodeIgniter</li>
<li>Rinomina  <em>facebook.php</em> in <em>facebook_pi.php (./system/plugins/facebook_pi.php)</em></li>
</ol>
<p><strong>AutoLoad Facebook Plugin</strong></p>
<p>Eventualmente puoi fare in modo che la Facebook Platform venga inizializzata automaticamente ad ogni caricamento. Per farlo è sufficiente modificare <em>./system/config/autoload.php</em> e modificare questa riga</p>
<blockquote><pre class="brush: php;">
$autoload['plugin'] = array('facebook');</pre>
</blockquote>
<p>Altrimenti ti basta inserire questa riga in tutte le pagine che verranno richieste da Facebook</p>
<blockquote><pre class="brush: php;">
$this-&#62;load-&#62;plugin('facebook');</pre>
</blockquote>
<p><strong>Configura la tua applicazione</strong></p>
<p>A questo punto dovrai configurare la tua applicazione affinchè possa essere eseguita in Facebook.</p>
<p>Modifica .<em>/system/application/config/config.php </em>in questo modo:</p>
<blockquote><pre class="brush: php;">
$config['uri_protocol'] = &#34;PATH_INFO&#34;;
$config['base_url'] = &#34;APPLICATION_URL&#34;;
</pre>
</blockquote>
<p><strong>N.B.</strong> Se stai eseguendo l&#8217;applicazione in localhost in $config['base_url'] devi inserire <em>http://127.0.0.1/path_applicazione</em></p>
<p><em><br />
</em></p>
<p><strong>Modifica della Classe Controller</strong></p>
<p>Se tutti i controller della tua applicazione dovranno essere eseguiti in Facebook allora dovrai modificare questa classe</p>
<p>Perciò vai in ./system/libraries/Controller.php e modifica il metodo costruttore <strong>Controller()</strong> in questo modo</p>
<blockquote><pre class="brush: php;">
function Controller()
{
parent::CI_Base();
$this-&#38;gt;_ci_initialize();
log_message('debug', &#34;Controller Class Initialized&#34;);
$secret = 'LA TUA SECRET KEY';

$api_key = 'LA TUA API KEY';

// Previene la notifica'Undefined index: facebook_config'
$GLOBALS['facebook_config']['debug'] = NULL;
parse_str($_SERVER['QUERY_STRING'],$_GET);
// Crea un nuovo oggetto Facebook
$this-&#38;gt;facebook = new Facebook($api_key, $secret);
$this-&#38;gt;uid = $this-&#38;gt;facebook-&#38;gt;require_login();

}
</pre>
</blockquote>
<p>In questo modo in tutti i controller (che per definizione devono estendere la classe Controller)  potrai utilizzare le API di Facebook.</p>
<p>Tutte le chiamate dovranno essere fatte sull&#8217;oggetto <strong>$this-&#62;facebook</strong> e <strong>$this-&#62;uid</strong> corrisponde alla USER ID dell&#8217;utente loggato in sessione Facebook.</p>
<p>Ad esempio per ottenere la lista amici dell&#8217;utente loggato</p>
<blockquote><pre class="brush: php;">$friend_list = $this-&#62;facebook-&#62;api_client-&#62;friends_get();</pre>
</blockquote>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[CRUD com Code Igniter Parte 3]]></title>
<link>http://samuelrbo.wordpress.com/2009/11/01/crud-com-code-igniter-parte-3/</link>
<pubDate>Sun, 01 Nov 2009 20:48:39 +0000</pubDate>
<dc:creator>samuelrbo</dc:creator>
<guid>http://samuelrbo.wordpress.com/2009/11/01/crud-com-code-igniter-parte-3/</guid>
<description><![CDATA[Dando continuidade ao CRUD. Vamos organizar as Views. Nesse artigo vou apanes mostrar como vai ficar]]></description>
<content:encoded><![CDATA[Dando continuidade ao CRUD. Vamos organizar as Views. Nesse artigo vou apanes mostrar como vai ficar]]></content:encoded>
</item>
<item>
<title><![CDATA[Cài đặt jQuery Uploadify với CodeIgniter]]></title>
<link>http://krazv7rvn9.wordpress.com/2009/10/30/cai-d%e1%ba%b7t-jquery-uploadify-v%e1%bb%9bi-codeigniter/</link>
<pubDate>Fri, 30 Oct 2009 10:36:35 +0000</pubDate>
<dc:creator>krazv7rvn9</dc:creator>
<guid>http://krazv7rvn9.wordpress.com/2009/10/30/cai-d%e1%ba%b7t-jquery-uploadify-v%e1%bb%9bi-codeigniter/</guid>
<description><![CDATA[jQuery Uploadify là một plugin cho phép upload nhiều file lên server cùng một lúc. Bạn có thể tải Up]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>jQuery Uploadify là một plugin cho phép upload nhiều file lên server cùng một lúc. Bạn có thể tải Uploadify <a href="http://www.uploadify.com/">tại đây</a>.<br />
Do Uploadify dựa vào Flash để upload file, kiểu file gửi lên server bao giờ cũng là <span style="font-style:italic;">application/octet-stream</span>, còn CodeIgniter lại chỉ hỗ trợ cơ chế kiểm tra file upload thông qua kiểu mimes để đảm bảo tính bảo mật của website, nên khi nhúng Uploadify vào CodeIgniter, chương trình sẽ không chạy theo ý mình.<br />
Để sửa lỗi này, có 2 cách thường được dùng:<br />
1 &#8211; Sửa lại CodeIgniter Upload library để nhận kiểu file thông qua file extension thay vì mime types.<br />
2 &#8211; Sửa lại file config/mimes.php trong ứng dụng, thêm vào kiểu &#8220;application/octet-stream&#8221; vào các kiểu file cho phép upload.<br />
Ngoài ra, ta có thể mở file .fla đi kèm với Uploadify và sửa lại nội dung file này để gửi kiểu file đúng cho CodeIgniter.<br />
Đối với cách 1, nếu người dùng cố tình đổi đuôi file (vd, từ .png thành .exe), chương trình sẽ lập tức từ chối, không cho phép người dùng upload lên (vì sai đuôi). Cách 2 tối ưu hơn cách 1, nhưng giả dụ bạn có 1 trang chỉ cho phép upload văn bản .txt, một trang cho up ảnh .png, vậy bạn phải sửa lại config/mimes.php 2 lần liền. Như vậy khá là mất thời gian ngồi sửa từng dòng của config/mimes.php<br />
Một cách trung gian là vẫn ứng dụng phép kiểm tra mimes của CI, nhưng thêm kiểu file &#8220;application/octet-stream&#8221; vào cho mỗi kiểu file được phép upload lên.<br />
Ta thực hiện phương pháp này bằng cách viết phần mở rộng <span style="font-weight:bold;">application/libraries/MY_Upload.php</span>:<br />
<code><br />
&#60;?php<br />
&#160;&#160;&#160; class MY_Upload extends CI_Upload<br />
&#160;&#160;&#160; {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var $allow_flash = FALSE;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; function initialize($config = array()){<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; parent::initialize($config);<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (array_key_exists('allow_flash', $config)) $this-&#62;allow_flash = $config['allow_flash'];<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; /**<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * Verify that the filetype is allowed<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; *<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * @access&#160;&#160;&#160; public<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * @param&#160;&#160;&#160; allow_flash = FALSE<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * @return&#160;&#160;&#160; bool<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; */&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; function is_allowed_filetype()<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (count($this-&#62;allowed_types) == 0 OR ! is_array($this-&#62;allowed_types))<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $this-&#62;set_error('upload_no_file_types');<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return FALSE;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />
&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $image_types = array('gif', 'jpg', 'jpeg', 'png', 'jpe');<br />
&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; foreach ($this-&#62;allowed_types as $val)<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $mime = $this-&#62;mimes_types(strtolower($val));<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ($this-&#62;allow_flash)<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (is_array($mime)) $mime[] = 'application/octet-stream'; else $mime = array($mime, 'application/octet-stream');<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Images get some additional checks<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (in_array($val, $image_types))<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (getimagesize($this-&#62;file_temp) === FALSE)<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return FALSE;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />
&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (is_array($mime))<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (in_array($this-&#62;file_type, $mime, TRUE))<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return TRUE;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ($mime == $this-&#62;file_type)<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return TRUE;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return FALSE;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />
&#160;&#160;&#160; } </p>
<p>/* End of file : application/libraries/MY_Upload.php */<br />
/* Author: Nguyen Dinh Trung &#60;nguyendinhtrung141@gmail.com&#62; */<br />
</code><br />
Giờ ta có thể thực hiện việc upload thông qua Uploadify bằng các Controllers và View sau:</p>
<p><span style="font-weight:bold;">Controller :</span> <span style="font-style:italic;">application/controllers/upload.php</span><br />
<code><br />
&#60;?php<br />
class Upload extends Controller<br />
{<br />
&#160;&#160;&#160; function Upload()<br />
&#160;&#160;&#160; {<br />
&#160;&#160;&#160; &#160;&#160;&#160; parent::Controller();<br />
&#160;&#160;&#160; &#160;&#160;&#160; $this-&#62;load-&#62;helper('form');<br />
&#160;&#160;&#160; &#160;&#160;&#160; $this-&#62;load-&#62;helper('url');<br />
&#160;&#160;&#160; }<br />
&#160;&#160;&#160; &#160;<br />
&#160;&#160;&#160; &#160;<br />
&#160;&#160;&#160; /*<br />
&#160;&#160;&#160; *&#160;&#160;&#160; Display upload form<br />
&#160;&#160;&#160; */<br />
&#160;&#160;&#160; function index()<br />
&#160;&#160;&#160; {<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />
&#160;&#160;&#160; &#160;&#160;&#160; $this-&#62;load-&#62;view('form');<br />
&#160;&#160;&#160; }<br />
&#160;&#160;&#160; &#160;<br />
&#160;&#160;&#160; /*<br />
&#160;&#160;&#160; *&#160;&#160;&#160; Handles JSON returned from /js/uploadify/upload.php<br />
&#160;&#160;&#160; */<br />
&#160;&#160;&#160; function uploadify()<br />
&#160;&#160;&#160; {<br />
&#160;&#160;&#160; &#160;&#160;&#160;<br />
&#160;&#160;&#160; &#160;&#160;&#160; $config['upload_path'] = APPPATH . 'assets/uploads/';<br />
&#160;&#160;&#160; &#160;&#160;&#160; $config['allow_flash'] = TRUE;<br />
&#160;&#160;&#160; &#160;&#160;&#160; $config['allowed_types'] = 'csv';<br />
&#160;&#160;&#160; &#160;&#160;&#160; $config['max_size']&#160;&#160;&#160; = '100';<br />
&#160;&#160;&#160; &#160;&#160;&#160; $config['max_width']&#160; = '1024';<br />
&#160;&#160;&#160; &#160;&#160;&#160; $config['max_height']&#160; = '768';<br />
&#160;&#160;&#160; &#160;&#160;&#160; $this-&#62;load-&#62;library('upload', $config);<br />
&#160;&#160;&#160; &#160;&#160;&#160; if (! $this-&#62;upload-&#62;do_upload('Filedata')){<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; echo ($this-&#62;upload-&#62;display_errors());&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;<br />
&#160;&#160;&#160; &#160;&#160;&#160; } else {<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; echo json_encode($this-&#62;upload-&#62;data());&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;<br />
&#160;&#160;&#160; &#160;&#160;&#160; }&#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />
&#160;&#160;&#160; }<br />
&#160;&#160;&#160; &#160;<br />
}<br />
/* End of File /application/controllers/upload.php */<br />
</code></p>
<p><span style="font-weight:bold;">View:</span> <span style="font-style:italic;">application/views/form.php</span><br />
<code><br />
&#60;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&#62;<br />
&#60;html xmlns="http://www.w3.org/1999/xhtml"&#62;<br />
&#60;head&#62;<br />
&#60;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&#62;<br />
&#60;title&#62;jQuery Uploadify Demo&#60;/title&#62;<br />
&#60;link rel="stylesheet" type="text/css" href="&#60;?php echo base_url();?&#62;js/uploadify/uploadify.css" /&#62;<br />
&#60;script type="text/javascript" language="javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"&#62;&#60;/script&#62;<br />
&#60;script type="text/javascript" language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&#62;&#60;/script&#62;<br />
&#60;script type="text/javascript" language="javascript" src="&#60;?php echo base_url();?&#62;assets/js/uploadify/jquery.uploadify.v2.1.0.min.js"&#62;&#60;/script&#62;<br />
&#160;<br />
&#160;&#160;&#160; &#60;script type="text/javascript" language="javascript"&#62;<br />
&#160;&#160;&#160; &#160;&#160;&#160; $(document).ready(function(){<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $("#upload").uploadify({<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; uploader: '&#60;?php echo base_url();?&#62;assets/js/uploadify/uploadify.swf',<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; script: '&#60;?php echo base_url();?&#62;upload/test',<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; cancelImg: '&#60;?php echo base_url();?&#62;assets/js/uploadify/cancel.png',&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; scriptAccess: 'always',<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; multi: true,<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; 'onError' : function (a, b, c, error) {<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (d.status == 404)<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; alert('Could not find upload script.');<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;else if (d.type === "HTTP")<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; alert('error '+d.type+": "+d.status);<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;else if (d.type ==="File Size")<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; alert(c.name+' '+d.type+' Limit: '+Math.round(d.sizeLimit/1024)+'KB');<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;else<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; alert('error '+error.type+": "+d.text);<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 'onComplete' : function(a,b,c,response,e) {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#notify").html(response);<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; });&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />
&#160;&#160;&#160; &#160;&#160;&#160; });<br />
&#160;&#160;&#160; &#60;/script&#62;<br />
&#60;/head&#62;<br />
&#160;<br />
&#60;body&#62;<br />
&#60;h1&#62;Uploadify Example&#60;/h1&#62;<br />
&#160;&#160;&#160; &#160;<br />
&#160;&#160;&#160; &#60;?php echo form_open_multipart('upload/index');?&#62;<br />
&#160;&#160;&#160; &#60;div id="notify"&#62; &#60;/div&#62;<br />
&#160;&#160;&#160;&#160;<br />
&#160;&#160;&#160; &#60;p&#62;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#60;label for="Filedata"&#62;Choose a File&#60;/label&#62;&#60;br/&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;?php echo form_upload(array('name' =&#62; 'Filedata', 'id' =&#62; 'upload'));?&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;a href="javascript:$('#upload').uploadifyUpload();"&#62;Upload File(s)&#60;/a&#62;<br />
&#160;&#160;&#160; &#60;/p&#62;<br />
&#160;&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;<br />
&#160;&#160;&#160; &#60;?php echo form_close();?&#62;<br />
&#160;&#160;&#160;&#160;<br />
&#60;/body&#62;<br />
&#60;/html&#62;<br />
  </code>
<div class="flockcredit" style="text-align:right;color:#CCC;font-size:x-small;">Blogged with the <a href="http://www.flock.com/blogged-with-flock" style="color:#999;font-weight:bold;" target="_new" title="Flock Browser">Flock Browser</a></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Using CodeIgniter and REST]]></title>
<link>http://webtech.wordpress.com/2009/10/27/using-codeigniter-and-rest/</link>
<pubDate>Tue, 27 Oct 2009 16:04:22 +0000</pubDate>
<dc:creator>webtech</dc:creator>
<guid>http://webtech.wordpress.com/2009/10/27/using-codeigniter-and-rest/</guid>
<description><![CDATA[]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><!-- SlideShare error: doc is missing or has illegal characters /[^-_a-zA-Z0-9]/ --></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Mengatasi BUG Codeigniter Session di IE7]]></title>
<link>http://idbd.wordpress.com/2009/10/26/mengatasi-bug-codeigniter-session-di-ie7/</link>
<pubDate>Mon, 26 Oct 2009 17:38:57 +0000</pubDate>
<dc:creator>ahdja</dc:creator>
<guid>http://idbd.wordpress.com/2009/10/26/mengatasi-bug-codeigniter-session-di-ie7/</guid>
<description><![CDATA[Ganti : $config['sess_cookie_name'] = &#8216;ci_session&#8217;; ke $config['sess_cookie_name'] = ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Ganti :<br />
$config['sess_cookie_name']    = &#8216;ci_session&#8217;;<br />
ke<br />
$config['sess_cookie_name']    = &#8216;cisession&#8217;;</p>
<p>atau</p>
<p>$config['sess_expiration']        = 7200;<br />
ke<br />
$config['sess_expiration']        = 72000;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[jQuery &amp; CodeIgniter trong form]]></title>
<link>http://krazv7rvn9.wordpress.com/2009/10/26/jquery-codeigniter-trong-form/</link>
<pubDate>Mon, 26 Oct 2009 10:14:46 +0000</pubDate>
<dc:creator>krazv7rvn9</dc:creator>
<guid>http://krazv7rvn9.wordpress.com/2009/10/26/jquery-codeigniter-trong-form/</guid>
<description><![CDATA[Làm sao để tạo một form Ajax với jQuery và thư viện Form_validation của CodeIgniter? Trước hết, ta t]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Làm sao để tạo một form Ajax với jQuery và thư viện Form_validation của CodeIgniter?<br />
Trước hết, ta tạo một controller như sau:<br />
<code><br />
class Devel extends Controllers<br />
{<br />
function index(){<br />
&#160;&#160;&#160;&#160;&#160;&#160; $this-&#62;load-&#62;library('form_validation');<br />
&#160;&#160;&#160;&#160;&#160; # Đặt các luật kiểm tra cho Form.<br />
&#160;&#160;&#160;&#160;&#160;&#160; $this-&#62;form_validation-&#62;set_rules("username", "Tên đăng nhập", "required&#124;trim&#124;xss_clean&#124;max_length(20)");<br />
&#160;&#160;&#160;&#160;&#160;&#160; $this-&#62;form_validation-&#62;set_rules("password", "Mật khẩu", "required&#124;trim&#124;xss_clean&#124;max_length(20)");<br />
&#160;&#160;&#160;&#160;&#160;&#160; $this-&#62;form_validation-&#62;set_rules("password_again", "Nhập lại Mật khẩu", "required&#124;trim&#124;xss_clean&#124;max_length(20)&#124;match(password)");<br />
&#160;&#160;&#160;&#160;&#160; if ($this-&#62;form_validation-&#62;run()){<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; # Form kiểm tra ok!<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo "&#60;div class='success'&#62;Đã kiểm tra form, không có lỗi gì hết!&#60;/div&#62;";&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160; } else {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; # Form chưa kiểm tra, hoặc chưa chạy.<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ($this-&#62;input-&#62;post('uniqueid')){<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; # Form đã khởi tạo và được chạy ít nhất 1 lần. Trả về mã lỗi kiểm tra form<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo "&#60;div class='error'&#62;".$this-&#62;form_validation-&#62;error_string()."&#60;/div&#62;";<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } else {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; # Chưa khởi tạo form.<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $default['username'] = 'username';<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $default['password'] = '';<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $default['password_again'] = '';<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $this-&#62;load-&#62;helper('string');<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $default['uniqueid'] = random_string('unique');<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $this-&#62;load-&#62;view('form', $default);<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />
&#160;&#160;&#160;&#160;&#160; }<br />
}<br />
}<br />
/* End of class Devel */<br />
/* Author : Nguyen Dinh Trung &#60;nguyendinhtrung141@gmail.com&#62; */<br />
</code><br />
Tiếp đó tạo view như sau:<br />
<code><br />
&#60;html&#62;<br />
&#160;&#160;&#160; &#60;head&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;title&#62;Example Form&#60;/title&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;script type='text/javascript' src='&#60;?= base_url(); ?&#62;assets/js/jquery.js'&#62;&#60;/script&#62;<br />
&#160;&#160;&#160; &#60;/head&#62;<br />
&#160;&#160;&#160; &#60;body&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;form id='myform' method='post'&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;div id="notify"&#62;&#60;/div&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;fieldset&#62;&#60;legend&#62;Xác nhận mật khẩu&#60;/legend&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;input type='hidden' name='uniqueid' value='&#60;?= $uniqueid; ?&#62;'&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;label for='username'&#62;Tên đăng nhập&#60;/label&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;input type='text' name='username' id='username' value='&#60;?= set_value('username', $username); ?&#62;'&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;label for='password'&#62;Mật khẩu&#60;/label&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;input type='password' name='password' id='password' value='&#60;?= set_value('password', $password); ?&#62;'&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;label for='password_again'&#62;Mật khẩu&#60;/label&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;input type='password_again' name='password_again' id='password_again' value='&#60;?= set_value('password_again', $password_again); ?&#62;'&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;/fieldset&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;fieldset&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;button type='button' id='submit'&#62;Gửi&#60;/button&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;button type='reset' id='reset'&#62;Nhập lại&#60;/button&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;/fieldset&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;/form&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;script type='text/javascript'&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(document).ready(function(){<br />
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160; $("#submit").click(function(){<br />
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160; $.post("&#60;?= current_url(); ?&#62;", $("#myform").serializeArray(), function(response){$("#notify").html(response);});<br />
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160; &#160;&#160; });<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; });<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;/script&#62;<br />
&#160;&#160;&#160; &#60;/body&#62;<br />
&#60;/html&#62;<br />
</code><br />
Với jQuery, ta có thể gửi form dễ dàng với phương thức POST bằng 1 dòng như sau:<br />
<code><br />
$.post("url", {"username":1234, "password":4567}, &#60;callback&#62;});<br />
</code><br />
Trong đó callback là hàm xử lý dữ liệu mà server trả về. Như trong file view ở trên, tôi lấy toàn bộ chuỗi văn bản mà server trả về, đem nhét nó vào trong vùng <span style="font-style:italic;">&#60;div id=&#8221;notify&#8221;&#62;&#60;/div&#62;.</span><br />
- Khi mới truy cập đến trang<span style="font-style:italic;"> devel/index,</span> do form chưa được khởi tạo nên không có giá trị gì trong biến<span style="font-style:italic;"> $this-&#62;input-&#62;post(&#8216;uniqueid&#8217;)</span>. Sự kiện này báo với controller rằng hãy hiển thị form và view với các thông số được chọn. Chuỗi uniqueid là một chuỗi ngẫu nhiên được tạo nhờ string helper của CI.<br />
- Sau khi người dùng bấm vào nút Submit, jQuery sẽ gửi dữ liệu lên Server. Dữ liệu được gửi chính là nội dung Form lấy được nhờ lệnh <span style="font-weight:bold;text-decoration:underline;font-style:italic;">$(&#8220;#myform&#8221;).serializeArray()</span>.<br />
- Tại server, CI nhận thấy có trường uniqueid, nên thay vì tạo form thông qua View, CI chỉ gửi lại thông báo lỗi (trong trường hợp Form không chạy), hoặc thông báo thành công (trong trường hợp kiểm tra thành công).<br />
- jQuery nhận được bản tin từ server và chèn chuỗi nhận được đó vào trong div id=&#8221;notify&#8221;.</p>
<div class="flockcredit" style="text-align:right;color:#CCC;font-size:x-small;">Blogged with the <a href="http://www.flock.com/blogged-with-flock" style="color:#999;font-weight:bold;" target="_new" title="Flock Browser">Flock Browser</a></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[PHP Frameworks Comparision]]></title>
<link>http://prabhulsankar.wordpress.com/2009/10/24/php-frameworks-comparision/</link>
<pubDate>Sat, 24 Oct 2009 15:42:46 +0000</pubDate>
<dc:creator>prabhulsankar</dc:creator>
<guid>http://prabhulsankar.wordpress.com/2009/10/24/php-frameworks-comparision/</guid>
<description><![CDATA[I recently spent some time to do some research on different php frameworks. I know there are a lot o]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I recently spent some time to do some research on different php frameworks. I know there are a lot of PHP MVC (Model View Controller) frameworks out there. But I tried checking only three of them &#8211; CodeIgniter, CakePHP and Zend framework. All these frameworks are Open Source. I&#8217;m not going to give you a detailed review of each and every point of each framework, as you can find lot of detailed reviews out there. This is just a conclusion on review of those.</p>
<p><a title="CodeIgniter Framework" href="http://codeigniter.com/" target="_blank">CodeIgniter</a></p>
<p>CodeIgniter is really a framework with very small footprint, as they claim it. It has all the MVC structure, scaffolding and all. Even though I don&#8217;t think scaffolding can be used for production purpose in it. CodeIgniter is basically a structure and some libraries and easy to learn compared to the other two frameworks I think. If you are about to start a project straight away and you want to use an MVC framework, then CodeIgniter is best option as the learning curve is small. And its also flexible, not strict on the MVC rules, as you have the option not to use models in the MVC structure and code around different ways you like to achieve the result you want.</p>
<p><a title="CakePHP" href="http://www.cakephp.org" target="_blank">CakePHP</a></p>
<p>CakePHP is also a very robust framework. I think we can define it as CakePHP is to PHP is more like what Rails is for Ruby (Correct me if I am wrong, as I&#8217;m not too much familiar with rails). The problem with CakePHP is the learning curve is more than that of CodeIgniter, and most importantly you need to code exactly how they want you to code. i.e. you have to follow exact naming conventions, even follow it in database field naming too. Even a missed underscore or a different name (than what they expect) for an object can pop up as an error. For example, if the model object name is &#8220;User&#8221; then the Controller object name for it has to be UsersController, exactly the same model object name in plural form. And this is a must and CakePHP will show errors if they don&#8217;t find the object. But the good part of that is if follow the conventions correct in CakePHP, everything falls in correct automatically. In addition to this the scaffolding feature of CakePHP is also brilliant.</p>
<p><a title="Zend Framework" href="http://framework.zend.com/" target="_blank">Zend Framework</a></p>
<p>I really didn&#8217;t got a chance to try too much in it, mainly because the learning curve far more bigger than the other two frameworks. Zend has a massive objects library (yeah I mean really BIG library). You can understand it by just by seeing the download file size of Zend framework, its around 12 MB whereas other frameworks mentioned above are only around 1.5 MB. Zend framework is not very strict in their conventions and coding compared to CakePHP I think. I would say its just a massive library in the MVC structure that can be used it whichever way we want it to be used for projects. But I&#8217;m still not familiar with Zend compared to the other two frameworks, so I may be wrong about. (Feel free shed some light on my review if you know more about Zend framework).</p>
<blockquote><p>Conclusion: To me I would pick CodeIgniter or CakePHP. I really can&#8217;t pick between these two. CakePHP needs some getting used to also, but I think it will help to standardize the coding as every coder has to follow same rules.</p></blockquote>
<p style="text-align:center;"><a name="pd_a_2162759"></a><div class="PDS_Poll" id="PDI_container2162759" style="display:inline-block;"></div><script type="text/javascript" language="javascript" charset="utf-8" src="http://static.polldaddy.com/p/2162759.js"></script>
		<noscript>
		<a href="http://answers.polldaddy.com/poll/2162759/">View This Poll</a><br/><span style="font-size:10px;"><a href="http://www.polldaddy.com">polls</a></span>
		</noscript></p>
<p>Feel free to post your comments about your experience with these frameworks.</p>
<p>Prabhul Sankar<br />
<a title="South Ocean Solutions - Web Design &#38; Development Services" href="http://www.southoceansolutions.com" target="_blank">www.southoceansolutions.com</a></p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
