Senin, 05 Mei 2014

Tutorial instalasi dan menggunakan framework phalcoln pada windows





Pada ppostingan ini saya akan membantu bagaimana cara menginstalasi dan menggunakan framework phalcoln

1.       Download PHALCOLN PHP disini


2.       Setelah di-download ekstrak lalu copy file php_phalcon.dll ke folder C:\xampp\php\ext\.


3.       Restart apache


4.       Dan terpasang


Setelah terpasang sekarang tinggal mengecek apakah sudah bisa digunakan atau belum.
buka notepad++ lalu masukan code berikut 

<?php print_r(get_loaded_extensions()); ?>

jika di jalankan  maka akan keluar output seperti ini :

/* * To change this template, choose Tools | Templates * and open the template in the editor. */ Array ( [0] => Core [1] => bcmath [2] => calendar [3] => ctype [4] => date [5] => ereg [6] => filter [7] => ftp [8] => hash [9] => iconv [10] => json [11] => mcrypt [12] => SPL [13] => odbc [14] => pcre [15] => Reflection [16] => session [17] => standard [18] => mysqlnd [19] => tokenizer [20] => zip [21] => zlib [22] => libxml [23] => dom [24] => PDO [25] => bz2 [26] => SimpleXML [27] => wddx [28] => xml [29] => xmlreader [30] => xmlwriter [31] => apache2handler [32] => openssl [33] => curl [34] => mbstring [35] => exif [36] => gd [37] => gettext [38] => mysql [39] => mysqli [40] => Phar [41] => pdo_mysql [42] => pdo_sqlite [43] => soap [44] => sockets [45] => sqlite3 [46] => xmlrpc [47] => xsl [48] => mhash )



jika sudah bisa maka phalcoln sudah aktif


get started

membuat bootstrap

Buka notepad++ lalu tuliskan code berikut dan bootstrap dimulai

<?php
 
try {
 
    //Register an autoloader
    $loader = new \Phalcon\Loader();
    $loader->registerDirs(array(
        '../app/controllers/',
        '../app/models/'
    ))->register();
 
    //Create a DI
    $di = new Phalcon\DI\FactoryDefault();
 
    //Setup the view component
    $di->set('view', function(){
        $view = new \Phalcon\Mvc\View();
        $view->setViewsDir('../app/views/');
        return $view;
    });
 
    //Setup a base URI so that all generated URIs include the "tutorial" folder
    $di->set('url', function(){
        $url = new \Phalcon\Mvc\Url();
        $url->setBaseUri('/tutorial/');
        return $url;
    });
 
    //Handle the request
    $application = new \Phalcon\Mvc\Application($di);
 
    echo $application->handle()->getContent();
 
} catch(\Phalcon\Exception $e) {
     echo "PhalconException: ", $e->getMessage();
}

  // code from phalcoln tutorial







Website-website yang menggunakan phalcoln  Antara lain

1.      http://kolesa.kz


2.       http://krisha.kz


3.       http://guitarama.ru/tabs/

4.       https://delete.im


Sumber : http://docs.phalconphp.com/en/latest/reference/tutorial.html  
Share:

0 komentar:

Posting Komentar