What's Prado?

The PRADO group is a team of PRADO enthusiasts who develop and promote the PRADO framework and the related projects.

Team Members

Past Team Members

Alex Flint, Brian Luft, John Teague, Todd Patrick, Pim van der Zwet, Tim Evans

History of PRADO

The very original inspiration of PRADO came from Apache Tapestry. During the design and implementation, I borrowed many ideas from Borland Delphi and Microsoft ASP.NET. The first version of PRADO came out in June 2004 and was written in PHP 4. Driven by the Zend PHP 5 coding contest, I rewrote PRADO in PHP 5, which proved to be a wise move, thanks to the new object model provided by PHP 5. PRADO won the grand prize in the Zend contest, earning high votes both from the public and from the judges' panel.

In August 2004, PRADO was hosted on SourceForge as an open source project. Soon after, the project site xisc.com was announced to public. With the fantastic support of PRADO developer team and PRADO users, PRADO evolved to version 2.0 in mid 2005. In this version, Wei Zhuo contributed to PRADO with the excellent I18 and L10N support.

In May 2005, we decided to completely rewrite the PRADO framework to resolve a few fundamental issues found in version 2.0 and to catch up with some cool features available in Microsoft ASP.NET 2.0. After nearly a year's hard work with over 50,000 lines of new code, version 3.0 was finally made available in April 2006.

Starting from version 3.0, significant efforts are allocated to ensure the quality and stability of PRADO. If we say PRADO v2.x and v1.x are proof-of-concept work, we can say PRADO 3.x has grown up to a serious project that is suitable for business application development.

Item Value
Latest version3.1.1
PHP4-
PHP5Prado Support PHP5
MVCPrado Support MVC
Multiple DBPrado Support Multiple DB
ORMPrado Support ORM
DB ObjectsPrado Support DB Objects
TemplatesPrado Support Templates
CachingPrado Support Caching
ValidationPrado Support Validation
AjaxPrado Support Ajax
Auth ModulePrado Support Auth Module
ModulesPrado Support Modules
EDPPrado Support Modules
CostFree
Official websitehttp://www.pradosoft.com/
Download URLhttp://www.pradosoft.com/download/
Manual URLhttp://www.pradosoft.com/documentation/
Installation

We start by setting up the directories and the files that are required by most PRADO applications. We use the PRADO command line tool to achieve this goal.

Assume blog is the name of the directory to hold the whole blog system, and the URL to access this folder is http://hostname/blog/ (replace hostname with the actual host name).

Under the blog directory, we run the PRADO command line tool with the following command (replace path/to with the actual path to the PRADO framework installation):

php path/to/prado-cli.php -c .

Running the above command creates the following directories and files:

We now have a skeleton PRADO application accessible via the URL http://hostname/blog/index.php which brings up a Web page showing "Welcome to PRADO".

It is beneficial to learn more details about the directories and files we just created.

Initial Files

The Entry Script

Every PRADO application has an entry script, often named as index.php. In most cases, it is the only PHP script that is directly accessible by Web users. This reduces the risk of allowing Web users to execute unwanted scripts on the server.

The main purpose of the entry script is to initialize the PRADO application and have it handle user requests. The entry script usually contains the following PHP statements,

<?php
// include prado.php which contains basic PRADO classes
require_once('path/to/prado.php');
// create a PRADO application instance

$application = new TApplication;
// run the application and handle user requests
$application->run();

?>
Info: The name of the entry script does not need to be index.php. It can be any name as long as the Web server can tell that the script is a PHP 5 script. For example, on some shared hosting environments, one may need to name the script as index.php5 so that it can be properly handled by the Web server.

Application Configuration

The optional XML file application.xml contains the application configuration. Its main purpose is to customize in a configurable fashion the application instance created in the entry script. For example, we may enable the logging feature for our blog system with the help of application configuration.

The file application.xml we have now is nearly empty. In fact, we may safely remove it because the application at the moment uses only default settings of PRADO. As we move forward, we will refer back constantly and show how to configure our application in application.xml.

Homepage

The homepage (also called default page) Home.page is the only page created by the PRADO command line tool. It is the content in this file that shows up in the browser when visiting the URL http://hostname/blog/index.php.

Content in the file Home.page uses the PRADO template format, which is mostly like HTML enhanced with a few PRADO-specific tags. For example, in Home.page we see the following pure HTML content:

<html>
<head>

  <title>Welcome to PRADO</title>
</head>
<body>
<h1>Welcome to PRADO!</h1>
</body>

</html>

Initial Directories

The protected Directory

The protected directory, also known as the application base path, is the root directory holding pages, templates, configurations, data, etc. The name protected indicates this directory should be hidden from Web users, because files under this directory often contain sensitive data.

Different Web servers have different ways of "protecting" a directory. For Apache httpd server, the easiest way is to place under the directory a file named .htaccess with the content deny from all.

The protected/runtime and assets Directories

The protected/runtime and assets directories are the two directories that must be set writable by the Web server process. The runtime directory stores sensitive data (e.g. parsed application configuration) generated when running a PRADO application, while the assets directory stores published resources (e.g. image files, javascript files).

Info: It is safe to remove files and directories under protected/runtime and assets. In fact, developers are recommended to do this cleanup work when they upgrade their PRADO installation.

The pages Directory

The pages directory is the root page directory holding all pages in a PRADO application. It bears an analogy to the htdocs directory for the Apache httpd Web server.

We already see how to access the homepage. To access an arbitrary page located under pages, use the URL http://hostname/blog/index.php?page=path.to.PageName. According to this URL, PRADO will look for a page named PageName under the directory pages/path/to. The URL we used to access the homepage previously is equivalent to http://hostname/blog/index.php?page=Home.

Customization

It is possible to customize the name and location of the files and directories described above.

For example, to improve security, one may want to move the whole protected directory to somewhere else that is not a Web folder. To do so, use the following PHP statement to create the application instance in the entry script:

$application = new TApplication( 'path/to/protected' );

To change the location of the root page directory and change the name of homepage, one can specify it in the application configuration application.xml as follows:

<?xml version="1.0" encoding="utf-8"?>

<application id="blog" mode="Debug">
  <services>

    <service id="page" 
           class="TPageService" 
           BasePath="path.to.pages"

           DefaultPage="NewHome"
           />
  </services>
</application>

As you learn more about PRADO, you will see that PRADO is such a flexible framework that it allows you to customize nearly every aspect. We will describe more customization techniques as we continue with our tutorial.

System Requirements

This page lists the requirements for the blog system that we are going to develop in this tutorial using PRADO. We are not including some popular blog features here (e.g. commenting, posts organizing, calendar, etc.), because we want to keep our tutorial short enough and we believe these features are easy to be added after you finish reading this tutorial.

In general, the blog system should allow users to read blogs and authenticated users to publish blogs. It should separate presentation and logic, and it should support changing themes.

User Management

  • The system shall allow authenticating and authorizing users.
  • The system shall allow the administrator to list all user accounts.
  • The system shall allow the administrator to create a new user account.
  • The system shall allow the administrator or the account holder to update an existing account.
  • The system shall allow the administrator to delete a user account.

Post Management

  • The system shall allow listing posts by their creation time in descending order with paging.
  • The system shall allow viewing the detail of a selected post.
  • The system shall allow creating a new post by an authenticated user.
  • The system shall allow updating an existing post by its author or administrator.
  • The system shall allow deleting an existing post by its author or administrator.

System Maintenance

  • The system shall be able to collect users' feedback.
  • The system shall be flexible enough to allow adding new portlets in future.
  • The system shall allow switching themes which define styles of the common UI elements.

Comments:

1 dRvoHcxyQJF

posted by:Your Name he or she think Prado is a framework,because:

Even though members can be academic experts and researchers, Yahoo! ,

2 Comment Title

posted by:martin he or she think Prado is a framework,because:

Best Framework i have ever seen. @Others: Prado very well supports MVC, but it is not so advertised like the other frameworks do. Take a deeper look into the quickstart tutorial and you'll see some big advantages! ;)

3 Comment Title

posted by:andyknownasabu he or she think Prado is a framework,because:

Coming from Apache Tapestry i.e. from the Java world I found PRADO to be the only PHP framework which is completely based on event driven programming (EDP). It also supports most if not all the other features available in other MVC frameworks but IMHO EDP is what pushed PHP web development to another level.

4 Comment Title

posted by:Gerard he or she think Prado is a framework,because:

Some nice features, some beautiful pieces of code but lack a lot of basic useful features in a web development context

5 Comment Title

posted by:Kiel he or she think Prado is a framework,because:

Interesting but lacks of MVC layer

6 Comment Title

posted by:rojaro he or she think Prado is a framework,because:

The chart is inaccurate. Prado has ORM, DB Objects and Modules.

7 Comment Title

posted by:Bandung he or she think Prado is a framework,because:

Even a simple web application created using Prado took no less than 5 minutes.

8 Comment Title

posted by:Ade ZM he or she think Prado is a framework,because:

This is a stable PHP5 Framework even for large scale web applications.

9 Comment Title

posted by:Serg he or she think Prado is a framework,because:

Good for small and highly interactive projects, but MVC architecture used in ZF and Symfony is more powerful and suitable for big projects as good as for small ones.

10 Comment Title

posted by:Laura he or she think Prado is a framework,because:

PRADO is the most advance PHP Framework.