summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Fundamentals/Components.page
diff options
context:
space:
mode:
authorwei <>2006-05-07 03:34:25 +0000
committerwei <>2006-05-07 03:34:25 +0000
commit30eddf57c8de433e8ea02b9e552c8e1744a505a7 (patch)
tree9e81f3a15f9a695cb96c5cc4dd80de5a3a0bb7b2 /demos/quickstart/protected/pages/Fundamentals/Components.page
parent0bb2822f68dfe3cf568affd4acf0d8120d9d53c7 (diff)
Add search to quickstart demo.
Diffstat (limited to 'demos/quickstart/protected/pages/Fundamentals/Components.page')
-rw-r--r--demos/quickstart/protected/pages/Fundamentals/Components.page16
1 files changed, 8 insertions, 8 deletions
diff --git a/demos/quickstart/protected/pages/Fundamentals/Components.page b/demos/quickstart/protected/pages/Fundamentals/Components.page
index c419a5fa..dc4da67c 100644
--- a/demos/quickstart/protected/pages/Fundamentals/Components.page
+++ b/demos/quickstart/protected/pages/Fundamentals/Components.page
@@ -1,10 +1,10 @@
<com:TContent ID="body" >
-<h1>Components</h1>
+<h1 id="701">Components</h1>
<p>
A component is an instance of <tt>TComponent</tt> or its child class. The base class <tt>TComponent</tt> implements the mechanism of component properties and events.
</p>
-<h2>Component Properties</h2>
+<h2 id="702">Component Properties</h2>
<p>
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 <tt>TControl</tt>, we define its <tt>ID</tt> property using the following getter and setter methods,
<com:TTextHighlighter CssClass="source">
@@ -34,7 +34,7 @@ $component->setID( $id );
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.
</p>
-<h3>Subproperties</h3>
+<h3 id="706">Subproperties</h3>
<p>
A subproperty is a property of some object-typed property. For example, <tt>TWebControl</tt> has a <tt>Font</tt> property which is of <tt>TFont</tt> type. Then the <tt>Name</tt> property of <tt>Font</tt> is referred to as a subproperty (with respect to <tt>TWebControl</tt>).
</p>
@@ -53,7 +53,7 @@ $component-&gt;getFont()-&gt;setName( $name );
</p>
-<h2>Component Events</h2>
+<h2 id="703">Component Events</h2>
<p>
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.
</p>
@@ -76,7 +76,7 @@ $button->attachEventHandler( 'OnClick' , $callback );
where <tt>$callback</tt> refers to a valid PHP callback (e.g. a function name, a class method <tt>array($object,'method')</tt>, etc.)
</p>
-<h2>Namespaces</h2>
+<h2 id="704">Namespaces</h2>
<p>
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).
</p>
@@ -102,12 +102,12 @@ which will include the class file if <tt>MyClass</tt> is not defined.
For more details about defining path aliases, see <a href="?page=Configurations.AppConfig">application configuration</a> section.
</p>
-<h2>Component Instantiation</h2>
+<h2 id="705">Component Instantiation</h2>
<p>
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.
</p>
-<h3>Dynamic Component Instantiation</h3>
+<h3 id="707">Dynamic Component Instantiation</h3>
<p>
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,
<com:TTextHighlighter CssClass="source">
@@ -117,7 +117,7 @@ $component = Prado::createComponent('ComponentType');
where <tt>ComponentType</tt> refers to a class name or a type name in namespace format (e.g. <tt>System.Web.UI.TControl</tt>). The second approach is introduced to compensate for the lack of namespace support in PHP.
</p>
-<h3>Static Component Instantiation</h3>
+<h3 id="708">Static Component Instantiation</h3>
<p>
Static component instantiation is about creating components via <a href="?page=Configurations.Overview">configurations</a>. The actual creation work is done by the PRADO framework. For example, in an <a href="?page=Configurations.AppConfig">application configuration</a>, 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 <a href="?page=Configurations.Templates1">templates</a>. 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 <tt>TButton</tt> component on the page,
<com:TTextHighlighter Language="prado" CssClass="source">