From 2a940641a38c12fa782dab73c77ceb895f913ee5 Mon Sep 17 00:00:00 2001
From: mcinp The optional prado-cli.php PHP script file in the framework
+
+ The optional prado-cli.php PHP script file in the bin
directory provides command line tools to perform various tedious takes in Prado.
The prado-cli.php can be used to create Prado project skeletons, create
initial test fixtures, and access to an interactive PHP shell.
@@ -14,7 +20,7 @@ the command line.
-If you type php path/to/framework/prado-cli.php, you should see
+If you type php path/to/bin/prado-cli.php, you should see
the following information. Alternatively, if you are not on Windows,
you may try to change the prado-cli.php into an executable
and execute it as a script To create a Prado project skeleton, do the following:
Templates are used to specify the presentational layout of controls. A template can contain static text, components, or controls that contribute to the ultimate presentation of the associated control. By default, an instance of TTemplateControl or its subclass may automatically load and instantiate a template from a file whose name is the same as the control class name. For page templates, the file name suffix must be .page; for other regular template controls, the suffix is .tpl.
The template format is like HTML, with a few PRADO-specifc tags, including component tags, template control tags, comment tags, dynamic content tags, and dynamic property tags. .
+ The template format is like HTML, with a few PRADO-specifc tags, including component tags, template control tags, comment tags, dynamic content tags, and dynamic property tags.
+Data controls are used to display a repeated content like a list or a table. The content is generated from a collection of items containing the data, called the DataSource, and a template describing the appearance, called Renderer.
+ * the tutorial for this control is not completed yet.
+ Standard controls are the most basic controls in PRADO. They can represent a simple html tag like an <input> or even more comple controls like a date picker or a WYSIWYG text area. Standard controls are in the System.Web.UI.WebControls namespace.
+
Applications are configured via application configurations. They are usually created in entry scripts like the following,
-PRADO is primarily a presentational framework, although it is not limited to be so. The framework focuses on making Web programming, which deals most of the time with user interactions, to be component-based and event-driven so that developers can be more productive. The following class tree depicts some of the major classes provided by PRADO,
+PRADO is primarily a presentational framework, although it is not limited to be so. The framework focuses on making Web programming, which deals most of the time with user interactions, to be component-based and event-driven so that developers can be more productive. The following class tree depicts some of the major classes provided by PRADO:
-When a PRADO application is processing a page request, its static object diagram can be shown as follows,
+When a PRADO application is processing a page request, its static object diagram can be shown as follows:
+Once the main Application object gets created, it load the application configuration.
+The minimal configuration defines a set of basic modules to parse the Request, create a proper Response, mantain the user Session, handle any Error and publish the needed Assets (images, css, javascript, etc). These helpers module will be available from anywhere inside the application code.
+
+Once the basic infrastructure has been set up, the Request module parses the request trying to identify the requested route. Different routes can be handled by different services, but the default route for http requests is the Page Service.
+
+A Page can be a simple script (.php), a Template (.page), or both. PRADO uses a very powerful template engine where Controls can be instanciated directly.
+
-A component is an instance of TComponent or its child class. The base class TComponent implements the mechanism of component properties and events.
-
-A component property can be viewed as a public variable describing a specific aspect of the component, such as the background color, the font size, etc. A property is defined by the existence of a getter and/or a setter method in the component class. For example, in TControl, we define its ID property using the following getter and setter methods,
-
-To get or set the ID property, do as follows, just like working with a variable,
-
-A property is read-only if it has a getter method but no setter method. Since PHP method names are case-insensitive, property names are also case-insensitive. A component class inherits all its ancestor classes' properties.
-
-A subproperty is a property of some object-typed property. For example, TWebControl has a Font property which is of TFont type. Then the Name property of Font is referred to as a subproperty (with respect to TWebControl).
-
-To get or set the Name subproperty, use the following method,
-
-A JavaScript-friendly property is a property that can accept both simple strings and raw javascript.
-Prado automatically encodes all properties sent clientside inside javascript blocks to avoid security problems (like injections or cross site scripting).
-If a property is known to always contain only safe javascript code and its value needs to bypass this encoding, that property can be defined in a special way that will make Prado mark its value as "safe".
-Js-friendly properties are identified by their name starting with 'js' (case insensitive):
-
-Component events are special properties that take method names as their values. Attaching (setting) a method to an event will hook up the method to the places at which the event is raised. Therefore, the behavior of a component can be modified in a way that may not be foreseen during the development of the component.
-
-A component event is defined by the existence of a method whose name starts with the word on. The event name is the method name and is thus case-insensitve. For example, in TButton, we have
-
-With the addition of behaviors, a more expansive event model is needed. There
-are two new event types (global and dynamic events) as well as a more comprehensive
-behavior model that includes class wide behaviors.
-
-A global event is defined by all events whose name starts with 'fx'.
-The event name is potentially a method name and is thus case-insensitive. All 'fx' events
-are valid as the whole 'fx' event/method space is global in nature. Any object may patch into
-any global event by defining that event as a method. Global events have priorities
-just like 'on' events; so as to be able to order the event execution. Due to the
-nature of all events which start with 'fx' being valid, in effect, every object
-has every 'fx' global event. It is simply an issue of tapping into the desired
-global event.
-
-A global event that starts with 'fx' can be called even if the object does not
-implement the method of the global event. A call to a non-existing 'fx' method
-will, at minimal, function and return null. If a method argument list has a first
-parameter, it will be returned instead of null. This allows filtering and chaining.
-'fx' methods do not automatically install and uninstall. To install and uninstall an
-object's global event listeners, call the object's listen and
-unlisten methods, respectively. An object may auto-install its global event
-during __construct by overriding getAutoGlobalListen and returning true.
-
-As of PHP version 5.3, nulled objects without code references will still continue to persist
-in the global event queue because __destruct is not automatically called. In the common
-__destruct method, if an object is listening to global events, then unlisten is called.
-unlisten is required to be manually called before an object is
-left without references if it is currently listening to any global events. This includes
-class wide behaviors.
-
-An object that contains a method that starts with 'fx' will have those functions
-automatically receive those events of the same name after listen is called on the object.
-
-An object may listen to a global event without defining an 'fx' method of the same name by
-adding an object method to the global event list. For example
-
-An intra-object/behavior event is defined by methods that start with 'dy'. Just as with
-'fx' global events, every object has every dynamic event. Any call to a method that
-starts with 'dy' will be handled, regardless of whether it is implemented. These
-events are for communicating with attached behaviors.
-
-Dynamic events can be used in a variety of ways. They can be used to tell behaviors
-when a non-behavior method is called. Dynamic events could be used as data filters.
-They could also be used to specify when a piece of code is to be run, eg. should the
-loop process be performed on a particular piece of data. In this way, some control
-is handed to the behaviors over the process and/or data.
-
-If there are no handlers for an 'fx' or 'dy' event, it will return the first
-parameter of the argument list. If there are no arguments, these events
-will return null. If there are handlers an 'fx' method will be called directly
-within the object. Global 'fx' events are triggered by calling raiseEvent.
-For dynamic events where there are behaviors that respond to the dynamic events, a
-TCallChain is developed. A call chain allows the behavior dynamic event
-implementations to call further implementing behaviors within a chain.
-
-If an object implements IDynamicMethods, all global and object dynamic
-events will be sent to __dycall. In the case of global events, all
-global events will trigger this method. In the case of behaviors, all undefined
-dynamic events which are called will be passed through to this method.
-
-
-There are two types of behaviors. There are individual object behaviors and
-there are class wide behaviors. Class behaviors depend upon object behaviors.
-
-When a new class implements IBehavior or IClassBehavior or
-extends TBehavior or TClassBehavior, it may be added to an
-object by calling the object's attachBehavior. The behaviors associated
-name can then be used to enableBehavior or disableBehavior
-the specific behavior.
-
-All behaviors may be turned on and off via enableBehaviors and
-disableBehaviors, respectively. To check if behaviors are on or off
-a call to getBehaviorsEnabled will provide the variable.
-
-Attaching and detaching whole sets of behaviors is done using
-attachBehaviors and detachBehaviors. clearBehaviors
-removes all of an object's behaviors.
-
-asa returns a behavior of a specific name. isa is the
-behavior inclusive function that acts as the PHP operator instanceof.
-A behavior could provide the functionality of a specific class thus causing
-the host object to act similarly to a completely different class. A behavior
-would then implement IInstanceCheck to provide the identity of the
-different class.
-
-Class behaviors are similar to object behaviors except that the class behavior
-is the implementation for all instances of the class. A class behavior
-will have the object upon which is being called be prepended to the parameter
-list. This way the object is known across the class behavior implementation.
-
-Class behaviors are attached using attachClassBehavior and detached
-using detachClassBehavior. Class behaviors are important in that
-they will be applied to all new instances of a particular class. In this way
-class behaviors become default behaviors to a new instances of a class in
-__construct. Detaching a class behavior will remove the behavior
-from the default set of behaviors created for an object when the object
-is instanced.
-
-Class behaviors are also added to all existing instances via the global 'fx'
-event mechanism. When a new class behavior is added, the event
-fxAttachClassBehavior is raised and all existing instances that are
-listening to this global event (primarily after listen is called)
-will have this new behavior attached. A similar process is used when
-detaching class behaviors. Any objects listening to the global 'fx' event
-fxDetachClassBehavior will have a class behavior removed.
-
-Dynamic events start with 'dy'. This mechanism is used to allow objects
-to communicate with their behaviors directly. The entire 'dy' event space
-is valid. All attached, enabled behaviors that implement a dynamic event
-are called when the host object calls the dynamic event. If there is no
-implementation or behaviors, this returns null when no parameters are
-supplied and will return the first parameter when there is at least one
-parameter in the dynamic event.
-
-Dynamic events can be chained together within behaviors to allow for data
-filtering. Dynamic events are implemented within behaviors by defining the
-event as a method.
-
-This implementation of a behavior and dynamic event will flow through to the
-next behavior implementing the dynamic event. The first parameter is always
-return when it is supplied. Otherwise a dynamic event returns null.
-
-In the case of a class behavior, the object is also prepended to the dynamic
-event.
-
-When calling a dynamic event, only the parameters are passed. The host object
-and the call chain are built into the framework.
-
-Given that all global 'fx' events and dynamic 'dy' events are valid and
-operational, there is a mechanism for catching events called that are not
-implemented (similar to the built-in PHP method __call). When
-a dynamic or global event is called but a behavior does not implement it,
-yet desires to know when an undefined dynamic event is run, the behavior
-implements the interface IDynamicMethods and method __dycall.
-
-In the case of dynamic events, __dycall is supplied with the method
-name and its parameters. When a global event is raised, via raiseEvent,
-the method is the event name and the parameters are supplied.
-
-When implemented, this catch-all mechanism is called for event global event event
-when implemented outside of a behavior. Within a behavior, it will also be called
-when the object to which the behavior is attached calls any unimplemented dynamic
-event. This is the fall-back mechanism for informing a class and/or behavior
-of when an global and/or undefined dynamic event is executed.
-
-A namespace refers to a logical grouping of some class names so that they can be differentiated from other class names even if their names are the same. Since PHP does not support namespace intrinsically, you cannot create instances of two classes who have the same name but with different definitions. To differentiate from user defined classes, all PRADO classes are prefixed with a letter 'T' (meaning 'Type'). Users are advised not to name their classes like this. Instead, they may prefix their class names with any other letter(s).
-
-A namespace in PRADO is considered as a directory containing one or several class files. A class may be specified without ambiguity using such a namespace followed by the class name. Each namespace in PRADO is specified in the following format,
-
-To use a namespace in code, do as follows,
-
-For more details about defining path aliases, see application configuration section.
-
-Component instantiation means creating instances of component classes. There are two types of component instantation: static instantiation and dynamic instantiation. The created components are called static components and dynamic components, respectively.
-
-Dynamic component instantiation means creating component instances in PHP code. It is the same as the commonly referred object creation in PHP. A component can be dynamically created using one of the following two methods in PHP,
-
-Static component instantiation is about creating components via configurations. The actual creation work is done by the PRADO framework. For example, in an application configuration, one can configure a module to be loaded when the application runs. The module is thus a static component created by the framework. Static component instantiation is more commonly used in templates. Every component tag in a template specifies a component that will be automatically created by the framework when the template is loaded. For example, in a page template, the following tag will lead to the creation of a TButton component on the page,
-
+A component is an instance of TComponent or its child class. The base class TComponent implements the mechanism of component properties and events.
+
+A component property can be viewed as a public variable describing a specific aspect of the component, such as the background color, the font size, etc. A property is defined by the existence of a getter and/or a setter method in the component class. For example, in TControl, we define its ID property using the following getter and setter methods,
+
+To get or set the ID property, do as follows, just like working with a variable,
+
+A property is read-only if it has a getter method but no setter method. Since PHP method names are case-insensitive, property names are also case-insensitive. A component class inherits all its ancestor classes' properties.
+
+A subproperty is a property of some object-typed property. For example, TWebControl has a Font property which is of TFont type. Then the Name property of Font is referred to as a subproperty (with respect to TWebControl).
+
+To get or set the Name subproperty, use the following method,
+
+A JavaScript-friendly property is a property that can accept both simple strings and raw javascript.
+Prado automatically encodes all properties sent clientside inside javascript blocks to avoid security problems (like injections or cross site scripting).
+If a property is known to always contain only safe javascript code and its value needs to bypass this encoding, that property can be defined in a special way that will make Prado mark its value as "safe".
+Js-friendly properties are identified by their name starting with 'js' (case insensitive):
+
+Component events are special properties that take method names as their values. Attaching (setting) a method to an event will hook up the method to the places at which the event is raised. Therefore, the behavior of a component can be modified in a way that may not be foreseen during the development of the component.
+
+A component event is defined by the existence of a method whose name starts with the word on. The event name is the method name and is thus case-insensitve. For example, in TButton, we have
+
+A namespace refers to a logical grouping of some class names so that they can be differentiated from other class names even if their names are the same. Since PHP does not support namespace intrinsically, you cannot create instances of two classes who have the same name but with different definitions. To differentiate from user defined classes, all PRADO classes are prefixed with a letter 'T' (meaning 'Type'). Users are advised not to name their classes like this. Instead, they may prefix their class names with any other letter(s).
+
+A namespace in PRADO is considered as a directory containing one or several class files. A class may be specified without ambiguity using such a namespace followed by the class name. Each namespace in PRADO is specified in the following format,
+
+To use a namespace in code, do as follows,
+
+For more details about defining path aliases, see application configuration section.
+
+Component instantiation means creating instances of component classes. There are two types of component instantation: static instantiation and dynamic instantiation. The created components are called static components and dynamic components, respectively.
+
+Dynamic component instantiation means creating component instances in PHP code. It is the same as the commonly referred object creation in PHP. A component can be dynamically created using one of the following two methods in PHP,
+
+Static component instantiation is about creating components via configurations. The actual creation work is done by the PRADO framework. For example, in an application configuration, one can configure a module to be loaded when the application runs. The module is thus a static component created by the framework. Static component instantiation is more commonly used in templates. Every component tag in a template specifies a component that will be automatically created by the framework when the template is loaded. For example, in a page template, the following tag will lead to the creation of a TButton component on the page,
+
+With the addition of behaviors, a more expansive event model is needed. There
+are two new event types (global and dynamic events) as well as a more comprehensive
+behavior model that includes class wide behaviors.
+
+A global event is defined by all events whose name starts with 'fx'.
+The event name is potentially a method name and is thus case-insensitive. All 'fx' events
+are valid as the whole 'fx' event/method space is global in nature. Any object may patch into
+any global event by defining that event as a method. Global events have priorities
+just like 'on' events; so as to be able to order the event execution. Due to the
+nature of all events which start with 'fx' being valid, in effect, every object
+has every 'fx' global event. It is simply an issue of tapping into the desired
+global event.
+
+A global event that starts with 'fx' can be called even if the object does not
+implement the method of the global event. A call to a non-existing 'fx' method
+will, at minimal, function and return null. If a method argument list has a first
+parameter, it will be returned instead of null. This allows filtering and chaining.
+'fx' methods do not automatically install and uninstall. To install and uninstall an
+object's global event listeners, call the object's listen and
+unlisten methods, respectively. An object may auto-install its global event
+during __construct by overriding getAutoGlobalListen and returning true.
+
+As of PHP version 5.3, nulled objects without code references will still continue to persist
+in the global event queue because __destruct is not automatically called. In the common
+__destruct method, if an object is listening to global events, then unlisten is called.
+unlisten is required to be manually called before an object is
+left without references if it is currently listening to any global events. This includes
+class wide behaviors.
+
+An object that contains a method that starts with 'fx' will have those functions
+automatically receive those events of the same name after listen is called on the object.
+
+An object may listen to a global event without defining an 'fx' method of the same name by
+adding an object method to the global event list. For example
+
+An intra-object/behavior event is defined by methods that start with 'dy'. Just as with
+'fx' global events, every object has every dynamic event. Any call to a method that
+starts with 'dy' will be handled, regardless of whether it is implemented. These
+events are for communicating with attached behaviors.
+
+Dynamic events can be used in a variety of ways. They can be used to tell behaviors
+when a non-behavior method is called. Dynamic events could be used as data filters.
+They could also be used to specify when a piece of code is to be run, eg. should the
+loop process be performed on a particular piece of data. In this way, some control
+is handed to the behaviors over the process and/or data.
+
+If there are no handlers for an 'fx' or 'dy' event, it will return the first
+parameter of the argument list. If there are no arguments, these events
+will return null. If there are handlers an 'fx' method will be called directly
+within the object. Global 'fx' events are triggered by calling raiseEvent.
+For dynamic events where there are behaviors that respond to the dynamic events, a
+TCallChain is developed. A call chain allows the behavior dynamic event
+implementations to call further implementing behaviors within a chain.
+
+If an object implements IDynamicMethods, all global and object dynamic
+events will be sent to __dycall. In the case of global events, all
+global events will trigger this method. In the case of behaviors, all undefined
+dynamic events which are called will be passed through to this method.
+
+
+There are two types of behaviors. There are individual object behaviors and
+there are class wide behaviors. Class behaviors depend upon object behaviors.
+
+When a new class implements IBehavior or IClassBehavior or
+extends TBehavior or TClassBehavior, it may be added to an
+object by calling the object's attachBehavior. The behaviors associated
+name can then be used to enableBehavior or disableBehavior
+the specific behavior.
+
+All behaviors may be turned on and off via enableBehaviors and
+disableBehaviors, respectively. To check if behaviors are on or off
+a call to getBehaviorsEnabled will provide the variable.
+
+Attaching and detaching whole sets of behaviors is done using
+attachBehaviors and detachBehaviors. clearBehaviors
+removes all of an object's behaviors.
+
+asa returns a behavior of a specific name. isa is the
+behavior inclusive function that acts as the PHP operator instanceof.
+A behavior could provide the functionality of a specific class thus causing
+the host object to act similarly to a completely different class. A behavior
+would then implement IInstanceCheck to provide the identity of the
+different class.
+
+Class behaviors are similar to object behaviors except that the class behavior
+is the implementation for all instances of the class. A class behavior
+will have the object upon which is being called be prepended to the parameter
+list. This way the object is known across the class behavior implementation.
+
+Class behaviors are attached using attachClassBehavior and detached
+using detachClassBehavior. Class behaviors are important in that
+they will be applied to all new instances of a particular class. In this way
+class behaviors become default behaviors to a new instances of a class in
+__construct. Detaching a class behavior will remove the behavior
+from the default set of behaviors created for an object when the object
+is instanced.
+
+Class behaviors are also added to all existing instances via the global 'fx'
+event mechanism. When a new class behavior is added, the event
+fxAttachClassBehavior is raised and all existing instances that are
+listening to this global event (primarily after listen is called)
+will have this new behavior attached. A similar process is used when
+detaching class behaviors. Any objects listening to the global 'fx' event
+fxDetachClassBehavior will have a class behavior removed.
+
+Dynamic events start with 'dy'. This mechanism is used to allow objects
+to communicate with their behaviors directly. The entire 'dy' event space
+is valid. All attached, enabled behaviors that implement a dynamic event
+are called when the host object calls the dynamic event. If there is no
+implementation or behaviors, this returns null when no parameters are
+supplied and will return the first parameter when there is at least one
+parameter in the dynamic event.
+
+Dynamic events can be chained together within behaviors to allow for data
+filtering. Dynamic events are implemented within behaviors by defining the
+event as a method.
+
+This implementation of a behavior and dynamic event will flow through to the
+next behavior implementing the dynamic event. The first parameter is always
+return when it is supplied. Otherwise a dynamic event returns null.
+
+In the case of a class behavior, the object is also prepended to the dynamic
+event.
+
+When calling a dynamic event, only the parameters are passed. The host object
+and the call chain are built into the framework.
+
+Given that all global 'fx' events and dynamic 'dy' events are valid and
+operational, there is a mechanism for catching events called that are not
+implemented (similar to the built-in PHP method __call). When
+a dynamic or global event is called but a behavior does not implement it,
+yet desires to know when an undefined dynamic event is run, the behavior
+implements the interface IDynamicMethods and method __dycall.
+
+In the case of dynamic events, __dycall is supplied with the method
+name and its parameters. When a global event is raised, via raiseEvent,
+the method is the event name and the parameters are supplied.
+
+When implemented, this catch-all mechanism is called for event global event event
+when implemented outside of a behavior. Within a behavior, it will also be called
+when the object to which the behavior is attached calls any unimplemented dynamic
+event. This is the fall-back mechanism for informing a class and/or behavior
+of when an global and/or undefined dynamic event is executed.
+
-Each page must have a template file. The file name suffix must be .page. The file name (without suffix) is the page name. PRADO will try to locate a page class file under the directory containing the page template file. Such a page class file must have the same file name (suffixed with .php) as the template file. If the class file is not found, the page will take class TPage.
+Each page can have a template file. The file name suffix must be .page. The file name (without suffix) is the page name. PRADO will try to locate a page class file under the directory containing the page template file. Such a page class file must have the same file name (suffixed with .php) as the template file. If the class file is not found, the page will take class TPage.
+A callback is a special form submission that, instead of requiring a full page reload on the browser, gets executed in the background through an ajax call. So, a callback is considered a postback too, but not vice versa.
+
Understanding the page lifecycles is crucial to grasp PRADO programming. Page lifecycles refer to the state transitions of a page when serving this page to end-users. They can be depicted in the following statechart,
diff --git a/demos/quickstart/protected/pages/Fundamentals/Services.page b/demos/quickstart/protected/pages/Fundamentals/Services.page
index 5e5889df..ee19a159 100755
--- a/demos/quickstart/protected/pages/Fundamentals/Services.page
+++ b/demos/quickstart/protected/pages/Fundamentals/Services.page
@@ -16,7 +16,7 @@ Developers may implement additional services for their applications. To make a s
-PRADO implements TPageService to process users' page requests. Pages are stored under a directory specified by the BasePath property of the page service. The property defaults to pages directory under the application base path. You may change this default by configuring the service in the application configuration.
+PRADO implements TPageService to process users' page requests. Pages are stored under a directory specified by the BasePath property of the page service. The property defaults to Pages directory under the application base path. You may change this default by configuring the service in the application configuration.
Pages may be organized into subdirectories under the BasePath. In each directory, there may be a page configuration file named config.xml, which contains configurations effective only when a page under that directory or a sub-directory is requested. For more details, see the page configuration section.
@@ -30,5 +30,8 @@ http://hostname/index.php?page=Users.Register
where the first example takes advantage of the fact that the page service is the default service and Home is the default page.
+More advanced url routes, like masking real page names and permitting the use of dynamic parameters can be created using the Url mapping module.
+
-Yes. PRADO was initially released in August 2004. Many test suites have been written and conducted frequently to ensure its quality. It has been used by thousands of developers and many Web applications have been developed based on it. Bugs and feature requests are managed through TRAC system and we have a great user community and development team to ensure all questions are answered in a timely fashion.
+Yes. PRADO was initially released in August 2004. Many test suites have been written and conducted frequently to ensure its quality. It has been used by thousands of developers and many Web applications have been developed based on it. Bugs and feature requests are managed through GitHub and we have a great user community and development team to ensure all questions are answered in a timely fashion.
-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 the highest votes from both the public and the judges' panel.
+The very original inspiration of PRADO came from Apache Tapestry. During the design and implementation, Qiang Xue 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, Qiang 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 the highest votes from both the public and the judges' panel.
In August 2004, PRADO started to be 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 I18N and L10N support.
@@ -64,6 +64,12 @@ In August 2004, PRADO started to be hosted on SourceForge as an open source proj
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.
+In October 2008, the original development team released a new framework called Yii. Inheriting most of the PRADO code, Yii left the pages/events concept, focusing on a pure MVC design pattern. Since 2009 a lot of people contributed to PRADO fixing issues, developing new features or backporting them from Yii.
+
+To promote a model of community-driven development, the project repositories were moved first on Google Code and then, in September 2013, on GitHub.
+
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 project that is suitable for serious business application development.
-The minimum requirement by PRADO is that the Web server support PHP 5.2. PRADO has been tested with Apache Web server on Windows and Linux. Highly possibly it may also run on other platforms with other Web servers, as long as PHP 5.2 is supported.
+The minimum requirement by PRADO is that the Web server support PHP 5.3.3. PRADO has been tested with Apache Web server on Windows, MacOSX and various Linux distro. Highly possibly it may also run on other platforms with other Web servers, as long as PHP 5.3.3 is supported.
-Installation of PRADO mainly involves downloading and unpacking.
+PRADO can be installed as a standalone package or using composer
If you encounter any problems with the demo applications, please use the PRADO requirement checker script, accessible via http://web-server-address/prado/requirements/index.php, to check first if your server configuration fulfills the conditions required by PRADO.
This tutorial introduces the basics of connecting to a database
- using ActiveRecord
- and using Active Record scaffolds to quickly
- build a simple address book.
- The class diagram for TActiveButton is illustrated in the figure below.
-Most active control that can perform callback request have a similar structure.
- TActiveButton is an extension of TButton
-and implements two additional interfaces ICallbackEventHandler and
-IActiveControl. The TActiveButton contains an instance of
-TBaseActiveCallbackControl
-available through the ActiveControl property of TActiveButton.
-The following example set the callback parameter of the TActiveButton when
-a callback request is dispatched.
- In the OnCallback event handler method, the CallbackParameter
-is available in the $param object. With in the ActiveControl property is an instance of
-TCallbackClientSide available
-as a property ClientSide of TActiveButton.
-The ClientSide property contains sub-properties, such as RequestTimeOut,
-and client-side javascript event handler, such as OnLoading,
-that are used by the client-side when making a callback request.
-The following example demonstrates the toggling of a "loading" indicator
-when the client-side is making a callback request.
- The example loads the "effects" javascript library using the
-TClientScript component.
-The ClientSide.OnLoading property value contains
-javascript statement that uses the "effects" library to show the "Loading..."
-span tag. Similarly, ClientSide.OnComplete property
-value contains the javascript statement that hides the "Loading..." span tag.
-See TCallbackClientSide for
-further details on client-side property details.
- See the Introduction
+
+Active controls extends standard PRADO controls adding the ability to automatically update themselves on callbacks without the need of ad-hoc javascript calls. See the Introduction
for a quick overview of the concept behind active controls (AJAX enabled controls).
Most active controls have a property of
ActiveControl and
@@ -373,92 +374,4 @@ if Javascript was disabled on the client's browser. The following classes provide the basic infrastructure classes required to
-realize the active controls. They can be useful to develop new active controls, but Prado users tipically don't need
-to use them.
- TActiveControlAdapter customizes the parent TControl class for active control classes.
- It tracks changes in the viewstate values of the control and update
- differences of the client-side HTML element attributes.
-
- TActiveListControlAdapter allows the adapted list controls to change the selections
- on the client-side during a callback request.
-
- TActivePageAdapter process the page life-cycle for callback requests.
-
- TBaseActiveControl class provided additional basic properties common for every
- active control. An instance of TBaseActiveControl or its decendent
- TBaseActiveCallbackControl is created by TActiveControlAdapter::getBaseActiveControl()
- method.
- The EnableUpdate property determines wether the active
- control is allowed to update the contents of the client-side when the callback
- response returns.
-
- TCallbackResponseAdapter alters the THttpResponse's outputs.
- A TCallbackResponseWriter is used instead of the TTextWrite when
- createHtmlWriter is called. Each call to createHtmlWriter will create
- a new TCallbackResponseWriter. When flushContent() is called each
- instance of TCallbackResponseWriter's content is flushed.
- The callback response data can be set using the ResponseData property.
- The following classes provide advanced properties and events needed to realize the active controls.
-A Prado user can use them to customize active controls behaviour and interact directly with the client side during a callback.
-
+A classic webpage can only transfer data back to the server using an http postback request that requires a full page reload. This is a problem for web applications, since a synchronous page reload breaks the user interaction: the user must wait for the response to arrive and the page will lose its current status (the scrolling position, the currently focused control, etc..).
+
+A common solution to this problem is the use of AJAX (Asynchronous JavaScript and XML) callbacks. After the first full page load, the web application can make subsequents requests using javascript. The callback requests are asynchronous, so the user can continue to interact with the page while the response is loading. The response contains a list of changes that will be applied to the page "on the fly", like replacing existing elements with new content or add some css style to an existing element.
+
+PRADO has builtin support for AJAX callbacks in the form of Active Controls. These controls can trigger a callback request and have their properties (value, css style, attributes, ..) updated during a callback.
+Before digging inside the list of Active Controls, it's good to have a look to how a page can be aware if the current request is a callback and how to interact with the page rendered on the client browser.
+
+Active controls extends standard PRADO controls adding the ability to automatically update themselves on callbacks without the need of ad-hoc javascript calls. Active controls are reliant on a collection of javascript classes that gets added to the page automatically when needed.
+
+Most active controls have a ActiveControl.EnableUpdate property that determines whether the active control is allowed to update the contents of the client-side when the callback response returns. Depending on the control different properties can be updated.
+
+Some active controls can trigger a callback as a consequence of a clientside event (a button click, a checkbox being checked, a DOM event). The callback will first raise the normal serverside event associated to the control (eg: OnClick for a TButton or OnSelectedIndexChanged for a TRadioButtonList) and then the OnCallBack event.
+The AutoPostBack property typically defaults to true for these controls.
+
+Active controls have a ClientSide property that provides many subproperties to customize the controls and to hook some javascript code to the callback lifecycle, like showing a "Loading" logo at the start of a callback and hide it at the end.
+ The class diagram for TActiveButton is illustrated in the figure below.
+Most active control that can perform callback request have a similar structure.
+ TActiveButton is an extension of TButton
+and implements two additional interfaces ICallbackEventHandler and
+IActiveControl. The TActiveButton contains an instance of
+TBaseActiveCallbackControl
+available through the ActiveControl property of TActiveButton.
+The following example set the callback parameter of the TActiveButton when
+a callback request is dispatched.
+ In the OnCallback event handler method, the CallbackParameter
+is available in the $param object. With in the ActiveControl property is an instance of
+TCallbackClientSide available
+as a property ClientSide of TActiveButton.
+The ClientSide property contains sub-properties, such as RequestTimeOut,
+and client-side javascript event handler, such as OnLoading,
+that are used by the client-side when making a callback request.
+The following example demonstrates the toggling of a "loading" indicator
+when the client-side is making a callback request.
+ The example loads the "effects" javascript library using the
+TClientScript component.
+The ClientSide.OnLoading property value contains
+javascript statement that uses the "effects" library to show the "Loading..."
+span tag. Similarly, ClientSide.OnComplete property
+value contains the javascript statement that hides the "Loading..." span tag.
+See TCallbackClientSide for
+further details on client-side property details.
+ The following classes provide the basic infrastructure classes required to
+realize the active controls. They can be useful to develop new active controls, but Prado users tipically don't need
+to use them.
+ TActiveControlAdapter customizes the parent TControl class for active control classes.
+ It tracks changes in the viewstate values of the control and update
+ differences of the client-side HTML element attributes.
+
+ TActiveListControlAdapter allows the adapted list controls to change the selections
+ on the client-side during a callback request.
+
+ TActivePageAdapter process the page life-cycle for callback requests.
+
+ TBaseActiveControl class provided additional basic properties common for every
+ active control. An instance of TBaseActiveControl or its decendent
+ TBaseActiveCallbackControl is created by TActiveControlAdapter::getBaseActiveControl()
+ method.
+ The EnableUpdate property determines wether the active
+ control is allowed to update the contents of the client-side when the callback
+ response returns.
+
+ TCallbackResponseAdapter alters the THttpResponse's outputs.
+ A TCallbackResponseWriter is used instead of the TTextWrite when
+ createHtmlWriter is called. Each call to createHtmlWriter will create
+ a new TCallbackResponseWriter. When flushContent() is called each
+ instance of TCallbackResponseWriter's content is flushed.
+ The callback response data can be set using the ResponseData property.
+ The following classes provide advanced properties and events needed to realize the active controls.
+A Prado user can use them to customize active controls behaviour and interact directly with the client side during a callback.
+
-Composition is the easiest way of creating new controls. It mainly involves instantiating existing controls, configuring them and making them the constituent components. The properties of the constituent components are exposed through subproperties.
+Composition is the easiest way of creating new controls. It mainly involves instantiating existing controls, configuring them and making them the constituent components. The properties of the constituent components are exposed through subproperties.
One can compose a new control in two ways. One is to extend TCompositeControl and override the TControl::createChildControls() method. The other is to extend TTemplateControl (or its child classes) and write a control template. The latter is easier to use and can organize the layout constituent components more intuitively, while the former is more efficient because it does not require parsing of the template.
diff --git a/demos/quickstart/protected/pages/Controls/id/NewControl.page b/demos/quickstart/protected/pages/Controls/id/NewControl.page
index ea083f6c..85c6eff0 100755
--- a/demos/quickstart/protected/pages/Controls/id/NewControl.page
+++ b/demos/quickstart/protected/pages/Controls/id/NewControl.page
@@ -10,7 +10,7 @@ Secara umum, ada dua cara penulisan kontrol baru: komposisi kontrol yang sudah a
-Komposisi adalah cara termudah membuat kontrol baru. Ia melibatkan terutama penurunan kontrol yang sudah ada, mengkonfigurasinya dan menjadikannya unsur komponen. Properti dari unsur komponen diperlihatkan melalui subproperti.
+Komposisi adalah cara termudah membuat kontrol baru. Ia melibatkan terutama penurunan kontrol yang sudah ada, mengkonfigurasinya dan menjadikannya unsur komponen. Properti dari unsur komponen diperlihatkan melalui subproperti.
Seseorang dapat menciptakan sebuah kontrol baru dalam dua cara. Pertama adalah memperluas TCompositeControl dan mengganti metode TControl::createChildControls(). Kedua adalah memperluas TTemplateControl (atau kelas anaknya) dan menulis template kontrol. Yang terakhir lebih mudah digunakan dan bisa mengatur tata letak unsur komponen lebih intuitif, sementara pembentuk lebih efisien karena ia tidak perlu menguraikan template.
diff --git a/demos/quickstart/protected/pages/Database/ActiveRecord.page b/demos/quickstart/protected/pages/Database/ActiveRecord.page
index 537c65e0..cf1485bd 100755
--- a/demos/quickstart/protected/pages/Database/ActiveRecord.page
+++ b/demos/quickstart/protected/pages/Database/ActiveRecord.page
@@ -129,7 +129,7 @@ You may specify qualified table names. E.g. for MySQL, TABLE = "`database1`.
More details regarding TComponent can be found in the Components documentation.
+ More details regarding TComponent can be found in the Components documentation.
Later we shall use the getter/setters to allow for lazy loading of relationship objects.
We first need to change the $skills=array() declaration to a private property
$_skills (notice the underscore) and set it to null instead. This allows us
to define the skills property using getter/setter methods
-(see Components for details). The getSkills()
+(see Components for details). The getSkills()
getter method for the skills property will lazy load the corresponding skills foreign record
when it is used as follows. Notice that we only do a lazy load when its $player_id is
not null (that is, when the record is already fetched from the database or player id was already set).
diff --git a/demos/quickstart/protected/pages/Database/id/ActiveRecord.page b/demos/quickstart/protected/pages/Database/id/ActiveRecord.page
index 454aa3f9..8e81678e 100755
--- a/demos/quickstart/protected/pages/Database/id/ActiveRecord.page
+++ b/demos/quickstart/protected/pages/Database/id/ActiveRecord.page
@@ -3,7 +3,7 @@
Rekaman Aktif adalah obyek yang melapisi baris dalam tabel atau view database,
melindungi akses database dan menambahkan logika domain pada data tersebut.
- Dasar dari Rekaman Aktif adalah kelas bisnis, sebagai contoh, kelas
+ Dasar dari Rekaman Aktif adalah kelas bisnis, sebagai contoh, kelas
Products, yang hampir menyamai struktur rekaman dari tabel database
dibawahnya. Setiap Rekaman Aktif akan bertanggung jawab atas
penyimpanan dan pengambilan data ke dan dari database. Rekaman Aktif adalah pilihan yang baik untuk logika domain yang tidak terlalu rumit,
+ Rekaman Aktif adalah pilihan yang baik untuk logika domain yang tidak terlalu rumit,
seperti membuat, membaca, memutakhirkan, dan menghapus. Derivasi dan validasi
didasarkan pada satu rekaman yang bekerja denga baik dalam struktur ini. Rekaman Aktif mempunyai kuntungan utama dalam hal kesederhanaan. Mudah untuk membangun Rekaman Aktif, dan mudah untuk dimengerti. Akan tetapi, seiring dengan perkembangan logika bisnis Anda dalm hal kompleksitas, Anda akan segera ingin menggunakan hubungan langsung obyek Anda, koleksi, turunan, dan seterusnya. Ini tidak mudah diterapkan ke dalam Rekaman Aktif, dan menambahkannya sedikit demi sedikit menjadi sangat kacau.
Argumen lain terhadap Rekaman Aktif adalah kenyataan bahwa ia menyandingkan desin obyek ke desain database. Ini menjadikannya lebih sulit untuk merefraktorisasi karena proyek terus berjalan. Alternatifnya adalah menggunakan Pemeta Data yang yang memisahkan aturan dari obyek bisnis dan bagaimana obyek ini disimpan.
+
+ Alternatifnya adalah menggunakan Pemeta Data yang yang memisahkan aturan dari obyek bisnis dan bagaimana obyek ini disimpan.
Prado menyediakan pilihan tambahan antara Rekaman Aktif dan
- Pemeta Data SqlMap.
- Pemeta Data SqlMap bisa dipakai untuk mengambil obyek Rekaman Aktif, hasilnya; obyek Rekaman Aktif ini bisa dipakai untuk memutakhirkan database.
+ Pemeta Data SqlMap.
+ Pemeta Data SqlMap bisa dipakai untuk mengambil obyek Rekaman Aktif, hasilnya; obyek Rekaman Aktif ini bisa dipakai untuk memutakhirkan database.
"Hubungan" antara Rekaman Aktif dan SqlMap digambarkan dalam diagram berikut. Lebih rinci mengenai Pemeta Data SqlMap dapat ditemukan dalam
Manual SqlMap.
alt="Rekaman Aktif dan SqlMap DataMapper" id="fig:diagram.png" class="figure"/>
Kelas Rekaman Aktif berfungsi untuk melakukan tugas-tugas berikut.
-Implementasi Prado terhadap Rekaman Aktif tidak memelihara identitas referensial. Setiap obyek diperoleh menggunakan Rekaman Aktif pada data dalam database. Sebagai contoh, jika Anda meminta kustomer tertentu dan mendapatkan kembali obyek Customer, kali berikutnya Anda meminta kustomer itu, Anda akan kembali mendapatkan turunan lain dari obyek Customer. Ini berarti bahwa perbandingan tepat (misalnya menggunakan ===) akan mengembalikan false, sementara perbandingan bebas (misalnya menggunakan ==) akan mengembalikan true jika nilai obyek sama menurut perbandingan bebas.
+Implementasi Prado terhadap Rekaman Aktif tidak memelihara identitas referensial. Setiap obyek diperoleh menggunakan Rekaman Aktif pada data dalam database. Sebagai contoh, jika Anda meminta kustomer tertentu dan mendapatkan kembali obyek Customer, kali berikutnya Anda meminta kustomer itu, Anda akan kembali mendapatkan turunan lain dari obyek Customer. Ini berarti bahwa perbandingan tepat (misalnya menggunakan ===) akan mengembalikan false, sementara perbandingan bebas (misalnya menggunakan ==) akan mengembalikan true jika nilai obyek sama menurut perbandingan bebas.
Implikasi desain ini terkait dengan pertanyaan berikut.
-"Anda pikir kustomer sebagai obyek, di mana hanya satu,
+"Anda pikir kustomer sebagai obyek, di mana hanya satu,
atau Anda pikir obyek yang Anda operasikan sebagai duplikat dari database?"
-Pemetaan O/R lain akan mengartikan bahwa hanya ada satu obyek Kustomer dengan custID 100, dan secara literal ia adalah kustomer.
-Jika Anda mendapatkan kustomer dan mengubah field-nya, maka Anda sekarang telah mengubah kustomer itu.
-"Itu berbatasan dengan: Anda telah mengubah duplikat kustomer ini, tapi bukan pada duplikat itu.
+Pemetaan O/R lain akan mengartikan bahwa hanya ada satu obyek Kustomer dengan custID 100, dan secara literal ia adalah kustomer.
+Jika Anda mendapatkan kustomer dan mengubah field-nya, maka Anda sekarang telah mengubah kustomer itu.
+"Itu berbatasan dengan: Anda telah mengubah duplikat kustomer ini, tapi bukan pada duplikat itu.
Dan jika dua orang memutakhirkan kustomer pada dua duplikat obyek, siapapun yang memutakhirkan pertama kali, atau mungkin yang terakhir yang menang." [A. Hejlsberg 2003]
-Implementasi Rekaman Aktif memanfaatkan kelas Prado DAO untuk akses data.
-Implementasi Rekaman Aktif saat ini mendukung database sebagai berikut.
+Implementasi Rekaman Aktif memanfaatkan kelas Prado DAO untuk akses data.
+Implementasi Rekaman Aktif saat ini mendukung database sebagai berikut.
Mari kita anggap tabel
- "users" berikut yang berisi dua kolom bernama "username" dan "email",
- di mana "username" juga merupakan kunci primer.
+ "users" berikut yang berisi dua kolom bernama "username" dan "email",
+ di mana "username" juga merupakan kunci primer.
Lebih jelas mengenai TComponent dapat ditemukan dalam Dokumentasi komponen.
+ Lebih jelas mengenai TComponent dapat ditemukan dalam Dokumentasi komponen.
Nantinya kita harus dapat menggunakan pengambil/penyetel guna membolehkan pengambilan malas atas obyek yang berhubungan.
- Metode statis finder() mengembalilkan turunan UserRecord
+ Metode statis finder() mengembalilkan turunan UserRecord
yang dapat dipakai untuk mengambil rekaman dari database. Pengambilan rekaman menggunakan metode finder akan didiskusikan nanti. Metode statis TActiveRecord::finder() mengambil nama kelas Rekaman Aktif sebagai parameter.
Alternatifnya, Anda dapat membuat basis kelas dan mengganti metode getDbConnection() untuk mengembalikan
koneksi database. Ini adalah cara sederhana untuk mengijinkan koneksi database multipel. Kode berikut mendemonstrasikan penetapan koneksi database dalam sebuah basis kelas (tidak perlu menyetel koneksi DB di manapun juga).
@@ -178,13 +178,13 @@ class MyDb2Record extends TActiveRecord
return $conn;
}
}
-
+
- Koneksi database standar dapat juga dikonfigurasi menggunakan tag <module> dalam application.xml
+ Koneksi database standar dapat juga dikonfigurasi menggunakan tag <module> dalam application.xml
atau config.xml seperti berikut.
Mencari rekaman menggunakan SQL penuh di mana findBySql() mengembalikan Rekaman Aktif dan findAllBySql()mengembalikan array obyek rekaman.
Untuk setiap kolom yang dikembalikan, kelas Rekaman Aktif terkait harus mendefinisikan variabel atau properti untuk setiap nama kolom terkait.
@@ -371,7 +371,7 @@ Obyek dimutakhirkan dengan kunci primer dari tabel itu yang berisi definisi yang
Sebagai contoh, jika Anda menyisipkan sebuah rekaman baru ke dalam tabel MySQL yang kolomnya didefinisikan dengan "autoincrement", obyek Rekaman Aktif akan dimutakhirkan dengan nilai yang ditambahkan.
-Untuk memutakhirkan rekaman dalam database, cukup ubah satu atau lebih properti obyek Rekaman Aktif yang sudah diambil dari database dan kemudian panggil metode save().
+Untuk memutakhirkan rekaman dalam database, cukup ubah satu atau lebih properti obyek Rekaman Aktif yang sudah diambil dari database dan kemudian panggil metode save().
Untuk menghapus rekaman yang sudah ada dan diambil, cukup panggil metode delete().
- Anda juga dapat menghapus rekaman dalam database dengan kunci primer tanpa mengambil rekaman apapun menggunakan metode deleteByPk() (dan metode yang sama deleteAllByPks()).
+ Anda juga dapat menghapus rekaman dalam database dengan kunci primer tanpa mengambil rekaman apapun menggunakan metode deleteByPk() (dan metode yang sama deleteAllByPks()).
Sebagai contoh, untuk menghapus satu atau beberapa rekaman dengan menggunakan satu atau lebih kunci primer.
-Event OnExecuteCommand dimunculkan ketika perintah dijalankan dan hasil dari database dikembalikan. Obyek parameter TDataGatewayResultEventParameter
-dari properti Result berisi data yang dikembalikan dari database.
+Event OnExecuteCommand dimunculkan ketika perintah dijalankan dan hasil dari database dikembalikan. Obyek parameter TDataGatewayResultEventParameter
+dari properti Result berisi data yang dikembalikan dari database.
Data yang dikembalikan dapat diubah dengan setelan properti Result.
Tujuannya adalah untuk mendapatkan model obyek yang mewakili ke beberapa derajat hubungan entitas dalam gambar di atas.
+ Tujuannya adalah untuk mendapatkan model obyek yang mewakili ke beberapa derajat hubungan entitas dalam gambar di atas.
Hubungan entitas antara tabel Teams dan Players adalah apa yang dikenal sebagai hubungan 1-M. Yaitu, satu Tim dapat berisi 0 atau lebih Pemain. Dalam batasan hubungan obyek, kita katakan bahwa obyek TeamRecord memiliki banyak obyek PlayerRecord.
+ Hubungan entitas antara tabel Teams dan Players adalah apa yang dikenal sebagai hubungan 1-M. Yaitu, satu Tim dapat berisi 0 atau lebih Pemain. Dalam batasan hubungan obyek, kita katakan bahwa obyek TeamRecord memiliki banyak obyek PlayerRecord.
(Perhatikan kebalikan dari arah hubungan antara tabel dan obyek.)
@@ -548,7 +548,7 @@ class TeamRecord extends TActiveRecord
const TABLE='Teams';
public $name;
public $location;
-
+
public $players=array(); // deklarasi ini tidak diperlukan lagi sejak v3.1.2
//mendefinisikan anggota $player yang memiliki hubungan banyak dengan PlayerRecord
@@ -616,7 +616,7 @@ Metode with_xxx() (di mana xxx adalah nama properti hubungan,
-Properti $RELATIONS dari PlayerRecord mendefinisikan properti $team milik TeamRecord.
-Array $RELATIONS juga mendefinisikan dua hubungan lainnya yang nanti akan kita uji dalam seksi di bawah ini.
-Dalam array(self::BELONGS_TO, 'TeamRecord'), elemen pertama mendefinisikan tipe hubungan, dalam hal ini self::BELONGS_TO dan
+Properti $RELATIONS dari PlayerRecord mendefinisikan properti $team milik TeamRecord.
+Array $RELATIONS juga mendefinisikan dua hubungan lainnya yang nanti akan kita uji dalam seksi di bawah ini.
+Dalam array(self::BELONGS_TO, 'TeamRecord'), elemen pertama mendefinisikan tipe hubungan, dalam hal ini self::BELONGS_TO dan
elemen kedua adalah string 'TeamRecord' yang terkait ke nama kelas dari kelas TeamRecord.
Obyek pemain dengan obyek tim terkait dapat diambil serperti berikut.
Intinya, ada hubungan "belongs to" untuk obyek yang mengaitkan entitas yang memmpunyai kolom yakni kunci asing. Dalam keadaan tertentu, kita melihat bahwa tabel Profiles mempunyai batasan kunci asing pada kolom player_id yang terkait ke tabel
Players kolom player_id. Selanjutnya, obyek ProfileRecord
memiliki properti ($player) yang adalah milik obyek PlayerRecord.
-Demikian juga, tabel Players mempunyai batasan kunci asing pada kolom team_name yang terkait ke tabel Teams kolom name.
+Demikian juga, tabel Players mempunyai batasan kunci asing pada kolom team_name yang terkait ke tabel Teams kolom name.
Kemudian, obyek PlayerRecord mempunyai properti ($team) yang adalah milik obyek TeamRecord.
Command Line Tool
-Usage
@@ -58,7 +64,7 @@ command line is in the prado distribution directory and you type.
Data Controls
+
+The process of assigning a DataSource to a Data control and render the template for each item is called data binding.
+
Standard Controls
-
Architecture
+Additionally, any 3rd-party or custom module can be loaded, and external Parameters can be loaded from external configurations.
+
+The Page Service's role is to instanciate the requested Page, run it, apply any defined Theme and grab the result in order to build the Response.
+
+A Control is an self-contained widget that fullfills a specific task; they can be a simple script (.php), a Template (.page), or both.
+Components
-Component Properties
-Subproperties
-Js-friendly properties
-Component Events
-
-
-Global events
-Events between Objects and their behaviors, Dynamic Events
-Behaviors
-Dynamic Intra-Object Events
-Global Event and Dynamic event catching
-
-Namespaces
-Component Instantiation
-Dynamic Component Instantiation
-Static Component Instantiation
-Components: Part I
+Component Properties
+Subproperties
+Js-friendly properties
+Component Events
+
+
+
+Namespaces
+Component Instantiation
+Dynamic Component Instantiation
+Static Component Instantiation
+Components: Part II
+Global events
+Events between Objects and their behaviors, Dynamic Events
+Behaviors
+Dynamic Intra-Object Events
+Global Event and Dynamic event catching
+
+PostBack
@@ -14,6 +14,18 @@ A form submission is called postback if the submission is made to the pag
+CallBack
+
+A callback is handled as a normal postback but, instead of re-rendering the entire page, only the specific changes occured on the page gets sent back to the client and merged with the current browser page. A typical callback response consists of:
+
+
+
+
Page Lifecycles
Page Service
Is PRADO Stable Enough?
History of PRADO
Standalone package
-
Composer install
+
+
A Simple Address Book
-
@@ -27,7 +26,7 @@
TActiveButton Class Diagram
-Adding Client Side Behaviour
-
-Active Controls (AJAX enabled Controls)
-Active Control Basic Infrastructure Classes
-
-
-
-TActiveControlAdapter
- TActiveListControlAdapter
- TActivePageAdapter
- TBaseActiveControl
- TCallbackResponseAdapter
- Active Control Infrastructure Advanced Classes
-
-
-
Overview of Active Controls
-
-TODO:
+AJAX: Introduction
+Interacting with a page on callback
+
+
+The IsCallBack property of the TPage class exposes whether the current request being handled is the consequence of a callback, and the CallbackClient property provides many methods to update and alter the client-side content during a callback request.
+Active Controls (AJAX enabled Controls)
+TActiveButton Class Diagram
+Adding Client Side Behaviour
+
+Active Control Basic Infrastructure Classes
+
+
+
+TActiveControlAdapter
+ TActiveListControlAdapter
+ TActivePageAdapter
+ TBaseActiveControl
+ TCallbackResponseAdapter
+ Active Control Infrastructure Advanced Classes
+
+
Composition of Existing Controls
Komposisi Kontrol yang Sudah Ada
Kapan Menggunakannya
-Implikasi Desain
Database yang Didukung
Mendefinisikan Rekaman Aktif
Menggunakan application.xml di dalam Kerangka Kerja Prado
findBySql() dan findAllBySql()
Menghapus rekaman yang sudah ada
Hubungan Rekaman Aktif
Pemetaan Kunci Asing
-
-Jawabannya adalah resolusi klasik yang telah dipakai oleh orang selama dekade ini yakni: buat tabel ekstra (tabel asosiasi) untuk merekam asosiasi. +Jawabannya adalah resolusi klasik yang telah dipakai oleh orang selama dekade ini yakni: buat tabel ekstra (tabel asosiasi) untuk merekam asosiasi. Ide dasarnya adalah menggunakan tabel asosiasi untuk menyimpan asosiasi. Tabel ini memiliki ID kunci asing untuk dua tabel yang dikaitkan bersama, masing-masing memiliki pasangan dari obyek yang diasosiasikan.
Tabel asosiasi tidak mempunyai kaitan obyek dalam-memori dan kunci primernya adalah gabungan dari dua kunci primer dari tabel yang diasosiasikan. -Dalam batasan yang sederhana, tuntuk mengambil data dari tabel asosiasi, Anda melakukan dua query (secara umum, ini juga bisa dicapai menggunakan satu query yang terdiri dari join). -Anggap pengambilan koleksi SkillRecord untuk daftar obyek PlayerRecord. +Dalam batasan yang sederhana, tuntuk mengambil data dari tabel asosiasi, Anda melakukan dua query (secara umum, ini juga bisa dicapai menggunakan satu query yang terdiri dari join). +Anggap pengambilan koleksi SkillRecord untuk daftar obyek PlayerRecord. Dalam hal ini, Anda melakukan query dalam dua tahap. Tahap pertama meng-query tabel Players untuk mencari seluruh baris dari pemain yang Anda inginkan. Tahap kedua mencari obyek SkillRecord ID pemain terkait untuk setiap barisnya dalam tabel asosiasi Player_Skills menggunakan sebuah inner join.
@@ -794,7 +794,7 @@ class SkillRecord extends TActiveRecordProperti statis $RELATIONS dari SkillRecord mendefinisikan bahwa properti $players memiliki banyak PlayerRecords melalui tabel asosiasi 'Player_Skills'. Dalam array(self::MANY_TO_MANY, 'PlayerRecord', 'Player_Skills'), elemen pertama mendefinisikan tipe hubungan, dalam hal ini self::HAS_MANY, -elemen kedua adalah string 'PlayerRecord' yang terkait ke nama kelas dari kelas PlayerRecord, dan elemen ketiga adalah nama dari nama tabel asosiasi. +elemen kedua adalah string 'PlayerRecord' yang terkait ke nama kelas dari kelas PlayerRecord, dan elemen ketiga adalah nama dari nama tabel asosiasi.
Untuk tabel asosiasi yang mererefensi dirinya sendiri, yaitu titik asosiasi ke tabel yang sama. Sebagai contoh, anggap tabel items dengan item terkait M-N melalui tabel asosiasi related_items. Sintaks dalam contoh berikut adalah benar untuk database PostgreSQL. Untuk database lain, lihat dokumentasinya masing-masing untuk mendefinisikan batasan kunci asing.
Nama tabel asosiasi dalam elemen ketiga dari array hubungan dapat berisi nama kolom tabel asing. Kolom yang didefinisikan dalam tabel asosiasi harus juga didefinisikan dalam kelas rekaman (contohnya properti $related_item_id terkait ke kolom related_item_id dalam tabel related_items). +
Nama tabel asosiasi dalam elemen ketiga dari array hubungan dapat berisi nama kolom tabel asing. Kolom yang didefinisikan dalam tabel asosiasi harus juga didefinisikan dalam kelas rekaman (contohnya properti $related_item_id terkait ke kolom related_item_id dalam tabel related_items).