PRADO
From Wikipedia, the free encyclopedia
PRADO | |
![]() |
|
Developer: | Prado Software Group |
---|---|
Latest release: | 3.1.0a / January 15, 2007 |
Use: | Web application framework |
License: | BSD License |
Website: | PRADO PHP Framework |
PRADO is a component-based and event-driven Web programming framework for PHP 5. PRADO reconceptualizes Web application development in terms of components, events and properties instead of procedures, URLs and query parameters. PRADO is an open source project.
PRADO stands for PHP Rapid Application Development Object-oriented.
Contents |
[edit] Influences
The design of PRADO was influenced heavily by ASP.NET and Borland Delphi.
[edit] Concepts
There are a number of concepts PRADO introduces (mostly borrowed from ASP.NET and such)
[edit] Namespaces
Namespaces are a logical grouping of class names so they can be uniquely identified from other class names, even if their names are the same.
- Prado::using(“PathAlias.Dir1.Dir2”);
- PathAlias is an alias to a path
- Dir1 is a literal directory relative to PathAlias
- Dir2 is a literal directory relative to Dir1
- Prado::using(“PathAlias.Dir1.Dir2.MyClass”);
- same as the previous example, except restricts it to a partciular class.
- Wildcards (*) are allowed
[edit] Components
Can be compared to Widgets in GTK/etc development.
- is an instance of TComponent or its child class.
- has subproperties (e.g. Font Name)
- $component->getSubProperty('Font.Name');
- has events
- events take method names as their input
- $component->OnClick->add("functionname");
- a number of ways to instanciate it
- $component = new ComponentName;
- $component = Prado::createComponent('ComponentName');
- in the XML .PAGE file <com:ComponentName Property=”Field” />
[edit] Controls
- is an instance of Tcontrol or its subclass.
- can be thought of as widgets
- is a component definition
- defines parent-child relationship among controls
- reflects the containment of user interface elements
- has IDs
- an ID which uniquely identifies it in code among its componets (within that node)
- a UniqueID which uniquely identifies it among all components
- ClientID used in HTML Tag ID's
- can have Naming Containers
- is for components that contain multiple items each having child controls with the same ID
- serves as a secondary ID to identify something with
[edit] Pages
Pages are top most controls that have no parent.
- Need a .page file and .php file
- .page file is a HTML file with XML nodes that represent components
- a form submission is called postback
- PRADO maps postbacks to the specific components on the server side
[edit] ViewSite and ControlState
- Stores controls in some persistent storage, such as form hidden fields or sessions, so when there's a postback, the controls status is maintained for the end user
[edit] Modules
- is an instance of a class which implmenets the Imodule interface.
- designed to provide functionality to any control
- instanciated in confguration files (XML)
- can replace Prado modules
- Request Module
- is the handler of user input
- PRADO by default uses ThttpRequest
- Response Module
- is the handler of output
- PRADO by default uses ThttpResponse
- Session Module
- Encapsuletes sessions
- PRADO uses THTTPSession by default (wrapper to PHP's Session())
- Error Handler Module
- Handles errors for user output
- TUserManager
- TAuthManager
- TTemplateManager
- TThemeManager
- etc
- Custom Modules
- Defined by you, you can extend existing PRADO modules
[edit] Services
- implements IService interface
- PRADO provides page and webservices service
- each kind of service handles a specific type of user request
- for example, the page service response to users requests for pages
- http://hostname/index.php?page=Bla
[edit] Applications
- is an instance of Tapplication or its derived class.
- manages modules that provide different functionalities and are loaded when needed.
- provides services to end-users.
- is the central place to store parameters used throughout the application.