diff options
Diffstat (limited to 'demos/quickstart/protected/pages/Fundamentals/Components.page')
-rw-r--r-- | demos/quickstart/protected/pages/Fundamentals/Components.page | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/demos/quickstart/protected/pages/Fundamentals/Components.page b/demos/quickstart/protected/pages/Fundamentals/Components.page index 20888fba..be71b18b 100644 --- a/demos/quickstart/protected/pages/Fundamentals/Components.page +++ b/demos/quickstart/protected/pages/Fundamentals/Components.page @@ -7,7 +7,7 @@ A component is an instance of <tt>TComponent</tt> or its child class. The base c <h2>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,
-<pre class="source">
+<com:TTextHighlighter Language="php" CssClass="source">
class TControl extends TComponent {
public function getID() {
...
@@ -16,7 +16,7 @@ class TControl extends TComponent { ...
}
}
-</pre>
+</com:TTextHighlighter>
</p>
<p>
To get or set the <tt>ID</tt> property, do as follows, just like working with a variable,
@@ -58,20 +58,20 @@ Component events are special properties that take method names as their values. </p>
<p>
A component event is defined by the existence of an <tt>on</tt>-method. For example, in <tt>TButton</tt>, we have
-<pre class="source">
+<com:TTextHighlighter Language="php" CssClass="source">
class TButton extends TWebControl {
public function onClick($param) {
...
}
}
-</pre>
+</com:TTextHighlighter>
This defines an event named <tt>Click</tt>, and a handler can be attached to the event using one of the following ways,
-<pre class="source">
+<com:TTextHighlighter Language="php" CssClass="source">
$button->Click=$callback;
$button->Click->add($callback);
$button->Click[]=$callback;
$button->attachEventHandler('Click',$callback);
-</pre>
+</com:TTextHighlighter>
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>
|