From 654a9cae43358c7eecf3b522e9876aa7815e2453 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Mon, 7 Dec 2015 15:57:51 +0100 Subject: Move urls from pradosoft.com to github's project page; drop unmaintained quickstart tutorial translations --- .../protected/pages/Day1/ShareLayout.page | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'demos/blog-tutorial/protected/pages/Day1/ShareLayout.page') diff --git a/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page b/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page index 6115ef22..a8d4b5bd 100755 --- a/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page +++ b/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page @@ -3,11 +3,11 @@

Sharing Common Layout

-In this section, we will use the master/content feature of PRADO to share common layout among pages. Common layout refers to the area that is the same or largely the same for a set of pages. For example, in our blog system, all pages will share the same header, footer and side-bar containing shortcut links. A straightforward implementation is to repeat the common layout in every page. However, this approach is prone to error and is hard to maintain. The master/content feature allows us to treat the common layout as a control which centralizes the logic and presentation of the common layout for every page. +In this section, we will use the master/content feature of PRADO to share common layout among pages. Common layout refers to the area that is the same or largely the same for a set of pages. For example, in our blog system, all pages will share the same header, footer and side-bar containing shortcut links. A straightforward implementation is to repeat the common layout in every page. However, this approach is prone to error and is hard to maintain. The master/content feature allows us to treat the common layout as a control which centralizes the logic and presentation of the common layout for every page.

-It is also possible to share common layout via template inclusion, which is like PHP file inclusion. The drawback of template inclusion is that it is not self-contained and does not carry a class to contain the logic for the common layout. +It is also possible to share common layout via template inclusion, which is like PHP file inclusion. The drawback of template inclusion is that it is not self-contained and does not carry a class to contain the logic for the common layout. @@ -52,9 +52,9 @@ For the moment, MainLayout only contains a simple header and a footer, The above shows the content in the template file MainLayout.tpl. Three new tags are used:

@@ -69,7 +69,7 @@ class MainLayout extends TTemplateControl -The file extension name for page templates is .page, while for non-page templates it is .tpl. This is to differentiate pages from other controls. They both use the same template syntax. For pages, their class files are optional (default to TPage), while for non-page controls, their class files are mandatory. Similar to Java, the name of a class file must be the same as the class name. Be careful about the case-sensitivity on Linux/Unix systems. +The file extension name for page templates is .page, while for non-page templates it is .tpl. This is to differentiate pages from other controls. They both use the same template syntax. For pages, their class files are optional (default to TPage), while for non-page controls, their class files are mandatory. Similar to Java, the name of a class file must be the same as the class name. Be careful about the case-sensitivity on Linux/Unix systems. @@ -110,15 +110,15 @@ It is possible to have multiple TContentPlaceHolder's in a master templ

-Besides <com:TContent>, we also see another new tag <%@ %> in the above, which is called template control tag. It contains name-value pairs which are used to initialize the corresponding properties for the template owner, namely, the Contact page. +Besides <com:TContent>, we also see another new tag <%@ %> in the above, which is called template control tag. It contains name-value pairs which are used to initialize the corresponding properties for the template owner, namely, the Contact page.

-By setting MasterClass property as Application.layouts.MainLayout, we instruct the Contact page to use MainLayout as its master. Here, we are using the namespace format to refer to the MainLayout class. +By setting MasterClass property as Application.layouts.MainLayout, we instruct the Contact page to use MainLayout as its master. Here, we are using the namespace format to refer to the MainLayout class.

-Namespace format is widely used in PRADO programming. It is used together with path aliases. PRADO defines two path aliases: System refers to the framework directory of the PRADO installation, and Application refers to the protected directory. The namespace Application.layouts.MainLayout can thus be translated as protected/layouts/MainLayout which is exactly the file name (without the extension .php) for the MainLayout class. +Namespace format is widely used in PRADO programming. It is used together with path aliases. PRADO defines two path aliases: System refers to the framework directory of the PRADO installation, and Application refers to the protected directory. The namespace Application.layouts.MainLayout can thus be translated as protected/layouts/MainLayout which is exactly the file name (without the extension .php) for the MainLayout class. @@ -151,7 +151,7 @@ In the above, we specify MasterClass in the onPreInit() method

-We can also specify master in application configuration or page configuration. The following shows the updated application configuration for our blog system: +We can also specify master in application configuration or page configuration. The following shows the updated application configuration for our blog system:

-- cgit v1.2.3