summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Configurations
diff options
context:
space:
mode:
authorxue <>2005-12-29 11:52:31 +0000
committerxue <>2005-12-29 11:52:31 +0000
commit658a7e1c4cf5a53dcd61ee196658090d00f2d64a (patch)
treec37b767c6e4d70baaf9ff471ce3721c9d8733f72 /demos/quickstart/protected/pages/Configurations
parentc0006cf0da8c3499060df7378cc376c98cbce7c4 (diff)
Used THighlighter to show code fragments.
Diffstat (limited to 'demos/quickstart/protected/pages/Configurations')
-rw-r--r--demos/quickstart/protected/pages/Configurations/AppConfig.page40
-rw-r--r--demos/quickstart/protected/pages/Configurations/PageConfig.page42
2 files changed, 41 insertions, 41 deletions
diff --git a/demos/quickstart/protected/pages/Configurations/AppConfig.page b/demos/quickstart/protected/pages/Configurations/AppConfig.page
index 101e449c..127f74a4 100644
--- a/demos/quickstart/protected/pages/Configurations/AppConfig.page
+++ b/demos/quickstart/protected/pages/Configurations/AppConfig.page
@@ -6,32 +6,32 @@ Application configurations are used to specify the global behavior of an applica
</p>
<p>
Configuration for an application is stored in an XML file named <tt>application.xml</tt>, which should be located under the application base path. Its format is shown in the following,
-<pre class="source">
-&lt;application PropertyName="PropertyValue" ...&gt;
- &lt;paths&gt;
- &lt;alias id="AliasID" path="AliasPath" /&gt;
- &lt;using namespace="Namespace" /&gt;
- &lt;/paths&gt;
- &lt;modules&gt;
- &lt;module id="ModuleID" class="ModuleClass" PropertyName="PropertyValue" ... /&gt;
- &lt;/modules&gt;
- &lt;services&gt;
- &lt;service id="ServiceID" class="ServiceClass" PropertyName="PropertyValue" ... /&gt;
- &lt;/services&gt;
- &lt;parameters&gt;
- &lt;parameter id="ParameterID" class="ParameterClass" PropertyName="PropertyValue" ... /&gt;
- &lt;/parameters&gt;
-&lt;/application&gt;
-</pre>
+<com:TTextHighlighter Language="xml" CssClass="source">
+<application PropertyName="PropertyValue" ...>
+ <paths>
+ <alias id="AliasID" path="AliasPath" />
+ <using namespace="Namespace" />
+ </paths>
+ <modules>
+ <module id="ModuleID" class="ModuleClass" PropertyName="PropertyValue" ... />
+ </modules>
+ <services>
+ <service id="ServiceID" class="ServiceClass" PropertyName="PropertyValue" ... />
+ </services>
+ <parameters>
+ <parameter id="ParameterID" class="ParameterClass" PropertyName="PropertyValue" ... />
+ </parameters>
+</application>
+</com:TTextHighlighter>
<ul>
<li>The outermost element <tt>&lt;application&gt;</tt> corresponds to the <tt>TApplication</tt> instance. The <tt>PropertyName="PropertyValue"</tt> pairs specify the initial values for the properties of <tt>TApplication</tt>.</li>
<li>The <tt>&lt;paths&gt;</tt> element contains the definition of path aliases and the PHP inclusion paths for the application. Each path alias is specified via an <tt>&lt;alias&gt;</tt> whose <tt>path</tt> attribute takes an absolute path or a path relative to the directory containing the application configuration file. The <tt>&lt;using&gt;</tt> element specifies a particular path (in terms of namespace) to be appended to the PHP include paths when the application runs. PRADO defines two default aliases: <tt>System</tt> and <tt>Application</tt>. The former refers to the PRADO framework root directory, and the latter refers to the directory containing the application configuration file.</li>
<li>The <tt>&lt;modules&gt;</tt> element contains the configurations for a list of modules. Each module is specified by a <tt>&lt;module&gt;</tt> element. Each module is uniquely identified by the <tt>id</tt> attribute and is of type <tt>class</tt>. The <tt>PropertyName="PropertyValue"</tt> pairs specify the initial values for the properties of the module.</li>
<li>The <tt>&lt;services&gt;</tt> element is similar to the <tt>&lt;modules&gt;</tt> element. It mainly specifies the services provided by the application.</li>
<li>The <tt>&lt;parameters&gt;</tt> element contains a list of application-level parameters that are accessible from anywhere in the application. You may specify component-typed parameters like specifying modules, or you may specify string-typed parameters which take a simpler format as follows,
-<pre class="source">
-&lt;parameter id="ParameterID"&gt;ParameterValue&lt;/parameter&gt;
-</pre>
+<com:TTextHighlighter Language="xml" CssClass="source">
+<parameter id="ParameterID">ParameterValue</parameter>
+</com:TTextHighlighter>
</li>
</ul>
By default without explicit configuration, a PRADO application when running will load a few core modules, such as <tt>THttpRequest</tt>, <tt>THttpResponse</tt>, etc. It will also provide the <tt>TPageService</tt> as a default service. Configuration and usage of these modules and services are covered in individual sections of this tutorial. Note, if your application takes default settings for these modules and service, you do not need to provide an application configuration. However, if these modules or services are not sufficient, or you want to change their behavior by configuring their property values, you will need an application configuration.
diff --git a/demos/quickstart/protected/pages/Configurations/PageConfig.page b/demos/quickstart/protected/pages/Configurations/PageConfig.page
index a7d0ef8e..2aff1fb9 100644
--- a/demos/quickstart/protected/pages/Configurations/PageConfig.page
+++ b/demos/quickstart/protected/pages/Configurations/PageConfig.page
@@ -9,27 +9,27 @@ When a user requests a page stored under <tt>&lt;BasePath&gt;/dir1/dir2</tt>, th
</p>
<p>
The format of a page configuration file is as follows,
-<pre class="source">
-&lt;configuration&gt;
- &lt;paths&gt;
- &lt;alias id="AliasID" path="AliasPath" /&gt;
- &lt;using namespace="Namespace" /&gt;
- &lt;/paths&gt;
- &lt;modules&gt;
- &lt;module id="ModuleID" class="ModuleClass" PropertyName="PropertyValue" ... /&gt;
- &lt;/modules&gt;
- &lt;authorization&gt;
- &lt;allow pages="PageID1,PageID2" users="User1,User2" roles="Role1,Role2" verb="get" /&gt;
- &lt;deny pages="PageID1,PageID2" users="User1,User2" roles="Role1,Role2" verb="post" /&gt;
- &lt;/authorization&gt;
- &lt;pages PropertyName="PropertyValue" ...&gt;
- &lt;page id="PageID" PropertyName="PropertyValue" ... /&gt;
- &lt;/pages&gt;
- &lt;parameters&gt;
- &lt;parameter id="ParameterID" class="ParameterClass" PropertyName="PropertyValue" ... /&gt;
- &lt;/parameters&gt;
-&lt;/configuration&gt;
-</pre>
+<com:TTextHighlighter Language="xml" CssClass="source">
+<configuration>
+ <paths>
+ <alias id="AliasID" path="AliasPath" />
+ <using namespace="Namespace" />
+ </paths>
+ <modules>
+ <module id="ModuleID" class="ModuleClass" PropertyName="PropertyValue" ... />
+ </modules>
+ <authorization>
+ <allow pages="PageID1,PageID2" users="User1,User2" roles="Role1,Role2" verb="get" />
+ <deny pages="PageID1,PageID2" users="User1,User2" roles="Role1,Role2" verb="post" />
+ </authorization>
+ <pages PropertyName="PropertyValue" ...>
+ <page id="PageID" PropertyName="PropertyValue" ... />
+ </pages>
+ <parameters>
+ <parameter id="ParameterID" class="ParameterClass" PropertyName="PropertyValue" ... />
+ </parameters>
+</configuration>
+</com:TTextHighlighter>
The <tt>&lt;paths&gt;</tt>, <tt>&lt;modules&gt;</tt> and <tt>&lt;parameters&gt;</tt> are similar to those in an application configuration. The <tt>&lt;authorization&gt;</tt> specifies the authorization rules that apply to the current page directory and all its subdirectories. It will be explained in more detail in future sections. The <tt>&lt;pages&gt;</tt> element specifies the initial values for the properties of pages. Each <tt>&lt;page&gt;</tt> element specifies the initial property values for a particular page identified by the <tt>id</code attribute. Initial property values given in the <tt>&lt;pages&gt;</tt> element apply to all pages in the current directory and all its subdirectories.
</p>