Showing posts with label php frameworks. Show all posts
Showing posts with label php frameworks. Show all posts

Tuesday, August 14, 2012

Yii Framework Tutorial For Beginners

Yii is an open source, object-oriented, component-based PHP web application framework. Yii is pronounced as "Yee" or [ji:] and it's an acronym for "Yes It Is!".

Yii is a free, open-source Web application development framework written in PHP5 that promotes clean, DRY design and encourages rapid development. It works to streamline your application development and helps to ensure an extremely efficient, extensible, and maintainable end product.

Yii Framework and its key concept: MVC


Setting up a development environment


Creating a skeleton application using yiic


Gii to create Models, Views, Controllers and CRUDs


Talking with Database


Yii Architectural Review


These tutorials are taken from here

Continue Reading...

Thursday, November 17, 2011

Codeigniter Hello World Tutorial

CodeIgniter is an open source PHP based Web Application Framework. CodeIgniter is based on the most popular web framework Model View Controller (MVC). This video tutorial is for absolute beginners. It will show you how you can make a simple Hello World Application using CodeIgniter.


 

if you know any other tutorials regarding CodeIgniter, Please Share it in comments.
Continue Reading...

Tuesday, January 18, 2011

Symfony Page Refresh / Reload

In this quick tutorial we will refresh the page using symfony i.e. we will call the same page form where is request is called lets do it...
public function executePageRefresh(sfWebRequest $request){
    //... something usefull here
    //... going back
    $this->redirect($request->getUri());
}
we use redirect function of symfony and method getUri() from $request object... getUri() give the complete URL inclucing the http and query string.
Continue Reading...

Sunday, December 26, 2010

Netbeans CodeIgniter Autocomplete Tutorial

Netbeans is really an ideal IDE for any sort of development. I just love to use it. Today we will configure Codeigniter in Netbeans with AUTO COMPLETE  feature, it takes about 2 minutes to configure Netbeans for Codeigniter.

Prerequisites

  • CodeIgniter Framework, you can download it from here.
  • Netbeans with PHP support, you can download it from here.
  • WAMP, you can download it from here.

Lets Roll

First download CodeIgniter form above mentioned link and extract the files, now open netbeans and create a PHP project from it New Project... > PHP > PHP Application name the project, say CI_CONFIG and save the project in www directory of wamp (or your PHP server) so that you can access it like http://localhost/CI_CONFIG/index.php
Now copy the CodeIgniter all files to netbeans Project Window as shown in the image below


Please Note, application folder of CodeIgnitor is outside with system folder (which by default is in the system folder)

Now open your web browser and try to run the project with the URL (which in our case is) http://localhost/CI_CONFIG/index.php, if every thing is OK CodeIgniter will greet you and you should be able to see this:


if you will not see this please check where the problem is and Don't forget to start wamp :)

Now, we will create a Controller in controllers directory which is in application/controllers right click on controllers folder New > PHP Class... and name it to say, mySite, copy the following code in mySite
<php

// auto complete goes here

class Mysite extends Controller {

    function Mysite(){ // Constructor
        parent::Controller();
    }
}
?>
at this point auto complete is not working you test is by typing $this-> , to make it work paste the following code as it is in the place of // auto complete goes here
/**
* @property CI_DB_active_record $db
* @property CI_DB_forge $dbforge
* @property CI_Benchmark $benchmark
* @property CI_Calendar $calendar
* @property CI_Cart $cart
* @property CI_Config $config
* @property CI_Controller $controller
* @property CI_Email $email
* @property CI_Encrypt $encrypt
* @property CI_Exceptions $exceptions
* @property CI_Form_validation $form_validation
* @property CI_Ftp $ftp
* @property CI_Hooks $hooks
* @property CI_Image_lib $image_lib
* @property CI_Input $input
* @property CI_Language $language
* @property CI_Loader $load
* @property CI_Log $log
* @property CI_Model $model
* @property CI_Output $output
* @property CI_Pagination $pagination
* @property CI_Parser $parser
* @property CI_Profiler $profiler
* @property CI_Router $router
* @property CI_Session $session
* @property CI_Sha1 $sha1
* @property CI_Table $table
* @property CI_Trackback $trackback
* @property CI_Typography $typography
* @property CI_Unit_test $unit_test
* @property CI_Upload $upload
* @property CI_URI $uri
* @property CI_User_agent $user_agent
* @property CI_Validation $validation
* @property CI_Xmlrpc $xmlrpc
* @property CI_Xmlrpcs $xmlrpcs
* @property CI_Zip $zip
* @property Image_Upload $image_upload
* @property Lang_Detect $lang_detect
* @property Address_Model $address_model
* @property Admin_Model $admin_model
* @property Buyer_Model $buyer_model
* @property Email_Model $email_model
* @property Product_Model $product_model
* @property Store_Model $store_model
* @property Tailor_Model $tailor_model
*/
now to test is auto complete is there or not yet we create a new method in Mysite
function sayHello(){
        
        $data['message']="Hey, Netbeans is Cooool";
        $this->load->view("sayHello", $data);

    }
when you are typing this you will see code completion feature and also it show documentation of a particular function or attribute as well, it will be something like this:


also create a view, sayHello.php in application/views and in it simply show the message
<?php

echo "

$message

"; ?>
and open your browser with the link http://localhost/CI_CONFIG/index.php/mySite/sayHello you will see following results


and for model just copy these lines at the start of your model class and it work like charm

/**
* @property CI_DB_active_record $db
* @property CI_DB_forge $dbforge
* @property CI_Config $config
* @property CI_Loader $load
* @property CI_Session $session
* @property Address_Model $address_model
* @property Admin_Model $admin_model
* @property Buyer_Model $buyer_model
* @property Email_Model $email_model
* @property Product_Model $product_model
* @property Store_Model $store_model
* @property Tailor_Model $tailor_model
*/
and that is it... you are good to go :)

References
CodeIgniter auto complete with Netbeans
Continue Reading...

Sunday, December 19, 2010

Codeigniter Tutorial For Beginners

if you want to learn Codeigniter there is no best way of doing this except for watching these videos and doing exactly same as it is been shown in these videos. ummm these videos are some what lengthy, go get some popcorn :)

Note : Thses Videos are taken form Net Tuts Plus

Lets Get Started


Connection to DB


Sending e-mail with GMail


Signing Up for Newsletter


Databse CRUD

CRUD : Create Read Update Delete


Session Management

Click Here to Download it

Pagination

Continue Reading...

Friday, December 17, 2010

Symfony Netbeans HelloWorld Tutorial

To day we will try to make a simple traditional "Hello World" application using the Symfony Framework in Netbeans, we will make this application from scratch, from configuring Symfony in Netbeans and then creating a module and so on, in a step by step manner.

Prerequisites

  • Symfony 1.4.x, you can download it form here
  • Netbeans with PHP support, you can download it from here
  • WAMP, you can download it from here
  • Little knowledge of PHP :)

Lets Start

Install Netbeans, WAMP server and then unzip Symfony and rename then extract folder to symfony (for simplicity). Now open Netbeans and go to Tools > Options > PHP (tab)


in PHP 5 interpreter filed browse to the PHP5 exe, which is located in %WAMP_INSTALL_DIR%\bin\php\php5.3.0\php.exe and below it there is an option for Global Include path in that Add the Folder of symphony (extracted one).

Now click on Symfony Tab

symfony tutorial

tell Netbeans where is Symfony Script is, it will be located in %SYMFONY_EXTRACTED_DIR%\data\bin\symfony notice it \bin\symfony with out any extension, click Ok button.

Now create a new PHP Project File > New Project... > PHP > PHP Application and press Next Button

symfony tutorial

name the project as HelloWorld and save the project in www directory of WAMP it will be %WAMP_INSTALL_DIR%\www\HelloWorld Click next button twice and you will see following screen.

symfony tutorial

check the Symfony PHP Web Framework  and click Finish. now Netbeans will create a Symfony Project with all the necessary configurations.

symfony tutorial

you will see a directory structure in Project window and a log of all the action taken by Netbeans, let run the project in a web browser, with following URL http://localhost/HelloWorld/web/

symfony tutorial

as you can see there is no CSS and images here, although Symfony is working, go to  %SYMFONY_EXTRACTED_DIR%\data\web and copy the sf folder and paste it in web directory of your project and refresh the page and you see a nice Welcome page.

symfony tutorial

now back to Netbeans, create a module mySite ,to do this  right click on Project > Symfony > Run Command ...

symfony tutorial

this will open a command console with all the command that Symfony support and it contains all the documentation associated with a command. we will use the generate:module command, we don't need to write the whole we just select the command form the list and provide parameters in the parameter filed in our case we pass frontend mySite telling symfony to create mySite module in fronted module. press Run Command.

symfony tutorial

now if you see your directory structure you will notice a module mySite is created with its action (Controller) and templates (View) folder and a default files are also created.

symfony tutorial

now open actions.class.php in actions folder and replace method executeIndex(sfWebRequest $request) with following code.
public function executeIndex(sfWebRequest $request)
  {
    $this->greetings="Hello World, Symfony is Great :)";
  }
now open indexSuccess.php located in templates folder this file is by defualt empty, in it paste the following code
<?php
    echo "

$greetings

"; ?> 
open web browser and navigate to the URL http://localhost/HelloWorld/web/frontend_dev.php/mySite it will also show a debugging toolbar which show very useful information, if you don't want debugging toolbar change URL to http://localhost/HelloWorld/web/index.php/mySite you should be able to see following page.

symfony tutorial
simple isn't it? :)

Note: there may be other ways, better ways of doing this, if you know such ways share them, this is the way i learn it .
Continue Reading...
 

Blog Info

A Pakistani Website by Originative Systems

Total Pageviews

Tutorial Jinni Copyright © 2015 WoodMag is Modified by Originative Systems