Showing posts with label netbeans tutorial. Show all posts
Showing posts with label netbeans tutorial. Show all posts

Thursday, December 30, 2010

Wordpress Netbeans Configuration & Plugin Development

This screencast demonstrates how to import WordPress sources as a NetBeans IDE project and use this project to create a simple plug-in.

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...

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...

Thursday, December 9, 2010

Symfony in Netbeans

A more Detail tutorial can be found here

Recently i started to learn Symfony (a php framework), i started with tutorials that are given on its site which are mostly command line base things, i want an IDE for that supports Symfony, so i googled as usual i was surprised to see my favorite (NetBeans) has out of the box support for it (i should i have known it before), i found an excellent screen castthat explain how to use Symfony in Netbeans.





Screen cast original located here and it by Jeff Rubinoff
Continue Reading...
 

Blog Info

A Pakistani Website by Originative Systems

Total Pageviews

Tutorial Jinni Copyright © 2015 WoodMag is Modified by Originative Systems