Template and LifeType Object

Template and LifeType Object

出自LifeType 中文文件計畫

(修訂版本間差異)
跳轉到: 導航, 搜尋
當前修訂版本 (2006年4月4日 (二) 12:25) (檢視原始碼)
 
第50行: 第50行:
以下是對所有模版有效的模版物件:  
以下是對所有模版有效的模版物件:  
-
$blog: An object containing information about the current blog, such as the name and description.
+
$blog: 一個包含當前blog的資訊(例如,名稱和描述)的物件
 +
$locale: Provides methods to translate strings based on the current locale. It also formats dates and numbers.  
$locale: Provides methods to translate strings based on the current locale. It also formats dates and numbers.  
-
$calendar: A string containing HTML code representing the calendar. It can be customized via CSS stylesheets.  
+
$calendar: 一條包含顯示日歷的HTML碼的字符串, 可以通過CSS Stylesheet對其進得客製化(customized).  
-
$archives: An array representing links to the archives. Each item represents a valid url pointing to the archives for that month. Archives are sorted chronologically, newest first, by months.  
+
$archives: 一個包含連至該文件的連結的陣列(An array representing links to the archives). 每一項代表該月的一條指向該文件的有效連結. 文件(Archives)按月份排列, 最新的排在前面.  
-
$recentposts: An array of post objects that contains the most recent posts made in the blog.  
+
$recentposts: 包含這個blog最近的文章的文章物件陣列.
-
$articlecategories: An array of category objects with all the different categories availables.  
+
$articlecategories: 包含所有有效類別(categories)的類別物件陣列.  
-
$mylinks: Cotains a list with all the links that have been set up for this blog.  
+
$mylinks: 這個blog建立的所有連結(links)的列表.  
-
$utils: Provides commodity methods to generate urls and other information.  
+
$utils: 提供常用方法(commodity methods)以生成urls及其他資訊.  
-
$rss: An RSS aggregator. See PLog 1.0/How to use the RSS aggregator for more information on this object.  
+
$rss: 一個RSS收集器(aggregator). 關於這個物件的詳細資訊請查看 PLog 1.0/How to use the RSS aggregator.  
Finally, it is also advisable to have a look at one of the template sets that comes with the main distribution of pLog.
Finally, it is also advisable to have a look at one of the template sets that comes with the main distribution of pLog.

當前修訂版本

How to create new template sets

當查看模版文件時, 你會發現類似: {$post->getTopic()}, {$calendar} 或是 {$utils->postPermalink($post)}的東西. 這些全都是輸出給模版使用的特殊物件. 以下是基本模版能使用的物件以及所有模版都能使用的物件的簡介:

以下對基本模版有效的模版物件:

main.template

$posts: 首頁所使用文章的陣列.

postandcomments.template

$post: 當前顯示的文章. * $comments: 當前文章的評論的陣列(comments)

$prevpost: 上一篇文章的物件, 如果存在(原文: A post object representing the next post in the database, if any).

$nextpost: 下一篇文章的物件, 如果存在(原文: Another post object representing now the previous post in the database, if any).

commentarticle.template

$post: 正在評論(comment on)的文章.

posttrackbacks.template

$post: 正在獲取trackback的文章.

$trackbacks: 當前文章的trackbacks的物件陣列.

error.template

$message: 一條錯誤訊息的字符串(String).

searchresults.template

tbd

albums.template

$albums

$album

resource.template

$resource

$albums


以下是對所有模版有效的模版物件:

$blog: 一個包含當前blog的資訊(例如,名稱和描述)的物件

$locale: Provides methods to translate strings based on the current locale. It also formats dates and numbers.

$calendar: 一條包含顯示日歷的HTML碼的字符串, 可以通過CSS Stylesheet對其進得客製化(customized).

$archives: 一個包含連至該文件的連結的陣列(An array representing links to the archives). 每一項代表該月的一條指向該文件的有效連結. 文件(Archives)按月份排列, 最新的排在前面.

$recentposts: 包含這個blog最近的文章的文章物件陣列.

$articlecategories: 包含所有有效類別(categories)的類別物件陣列.

$mylinks: 這個blog建立的所有連結(links)的列表.

$utils: 提供常用方法(commodity methods)以生成urls及其他資訊.

$rss: 一個RSS收集器(aggregator). 關於這個物件的詳細資訊請查看 PLog 1.0/How to use the RSS aggregator.

Finally, it is also advisable to have a look at one of the template sets that comes with the main distribution of pLog.