Prado Currency Converter Tutorial in NetBeans

In my last entry I described how to create a simple web PHP application based on the Prado Framework. It was a simple Hello World example and the whole project was created in NetBeans. In this entry I show you how to start a Currency Converter Prado tutorial. It does not make sense to duplicate the whole tutorial from the Prado web, so I show you how to start the project, because the steps in starting the project are the most specific to NetBeans.

The Prado framework contains the prado-cli.php script, which you can use to generate the structure of a new web php application based on Prado. Open a command line and change the directory to your document root. If you tried to create the Prado Hello World tutorial, you should already have the prado folder in your document root. If you don't have it, please read this entry. In the command line invoke the following command.

php prado/framework/prado-cli.php -c currency-converter

If the command was executed successfully, the currency-converter folder appears in your document root.

In the next step we import this project into NetBeans. Start NetBeans and invoke the New Project Wizard. Select PHP category and PHP Application with Existing sources.


Click on the Next > button. The Name and Location pane opens. For the source folder, select the created currency-converter folder. You don't have to change anything else.

You don't have to change anything in the last step either. Just click the Finish button.

The project now is created and open. It would be good if NetBeans knew about the Prado framework files, so put these files into the Include path. Select the Include Path node in the Project Explorer and invoke the Properties item from  the context menu. It opens the Project Properties dialog. In the dialog, add the prado/framework folder into the Include Path from your document root.

Now you can run the project. After invoking the Run action you should see the message "Welcome to Prado!" in your browser.

This is everything that is NetBeans-specific. From here you can continue with the tutorial according to the Prado web site



Comments:

Excelent!. Netbeans is getting stronger!!...

Is there some way to autocomplete Prado tags in \*.page, \*.tpl or \*.skin files? I mean, if there is some way to add these autocomplete rules to Netbeans...

That's just a question.

Thanks!

Posted by JDavidZ on August 27, 2008 at 06:27 PM CEST #

Hey guys, a quick question...

Will you be able to support the @property PHPDoc tag at some point in thie future?

Support for this would be great, as it would allow for the compltion of variables managed by the __get and __set magic methods.

Posted by Adam Jorgensen on August 28, 2008 at 04:01 AM CEST #

Hi JDavidZ,

unfortunately not. But there is based project, which will create support for Prado in NetBeans. I hope that first alpha version will be available soon.

Regards,
Petr

Posted by Petr on August 28, 2008 at 04:43 AM CEST #

Hi Adam,

in the current build we don't support it. Bu I have entered two issues for this:

http://www.netbeans.org/issue/show_bug.cgi?id=145408
http://www.netbeans.org/issue/show_bug.cgi?id=145411

You can add your comment there. It would be good to know, if you expect more, than I have describe in the second issue.

Hopefully it will be fixed in NB 6.5.

Thanks,
Petr

Posted by Petr on August 28, 2008 at 06:26 AM CEST #

The previous links are not correct. The correct links are:

http://www.netbeans.org/issues/show_bug.cgi?id=145408
http://www.netbeans.org/issues/show_bug.cgi?id=145411

Petr

Posted by Petr on August 28, 2008 at 02:01 PM CEST #

Hi!
Do you have any plans to support CakePHP in the future? Right now, I can develop application but it is not a very clean way to do so, I create an application from sources and it works but i don't get any kind of code completion from the cake libraries. Is there a solution for these problems?
Thanks, Joaquín

Posted by Joaquin Fernandez Campo on August 29, 2008 at 07:43 AM CEST #

Hi Joaquin,

put the cake libraries to the project include path. Go to the Project Properties dialog and there you can specify the include path.

Regards,
Petr

Posted by Petr on August 29, 2008 at 07:55 AM CEST #

Thanks Petr! It more or less worked. Let me explain:
When I'm working with controllers it works just fine but when I'm working with views it doesn't work. I believe it is because the controllers inherit from AppController but the view are .ctp files (I already told netbeans to treat them as php files) that don't inherit from anywhere for example:

[CODE]
<h1>Edit Post</h1>
<?php
echo $form->create('Post', array('action' => 'edit'));
echo $form->input('title');
echo $form->input('body', array('rows' => '3'));
echo $form->input('id', array('type'=>'hidden'));
echo $form->end('Save Post');
?>
[/CODE]
Any ideas?

Posted by Joaquín Fernández Campo on August 29, 2008 at 09:53 AM CEST #

Hi Joaquín,

I'm afraid that without specific support for Cake PHP, we will not able to provide a help in this situation. The problem, as you mentioned, is that the IDE can not know, how the $form is defined.

There is not such support yet for NetBeans 6.5. For the next release we want to make a support for a few frameworks. Which frameworks, it can be decide by community.

Regards,
Petr

Posted by Petr on August 29, 2008 at 01:09 PM CEST #

Well thanks for your answer.
How are you going to decide which framework to support and which one not to? Are you going to poll the comunnity about it? Thanks

Posted by Joaquín Fernández Campo on September 01, 2008 at 01:02 PM CEST #

Hi Joaquín,

basically you are right. The community can very significantly influence, which one will be done as first. I'm talking about official support.

You can vote in our issuezilla. Find or base issue about the framework, which you want and vote for it.

Regards,
Petr

Posted by Petr on September 02, 2008 at 07:16 AM CEST #

I tried it at forexrate.com.au and it worked first time. Thanks everyone!

Posted by currency converter on February 24, 2009 at 09:40 PM CET #

Hi!

Your posts are very helpful, thx.

By the way, the like at the end, to prado tutorial page (http://planet.pradosoft.com/demos/quickstart/?page=Tutorial.CurrencyConverter), use to work.

I found this tutorial on this PDF : http://www.pradosoft.com/docs/quickstart.pdf. After your posts, we can follow this from § 3.4.

Best regards.

PS: sorry for my bad english...

Posted by Acasanva on September 02, 2011 at 06:53 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blogs is written by NetBeans developers who contribute to the PHP support mainly.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today