浏览代码

set default values

euromark 12 年之前
父节点
当前提交
0f61d24983
共有 2 个文件被更改,包括 7 次插入0 次删除
  1. 1 0
      Test/Case/View/RssViewTest.php
  2. 6 0
      View/RssView.php

+ 1 - 0
Test/Case/View/RssViewTest.php

@@ -328,6 +328,7 @@ RSS;
   <channel>
     <title>Channel title</title>
     <admin:errorReportsTo rdf:resource="mailto:me@example.com"/>
+    <link>$this->baseUrl/</link>
     <description/>
     <item>
       <title>Title One</title>

+ 6 - 0
View/RssView.php

@@ -109,6 +109,12 @@ class RssView extends View {
 	 * @return array Channel
 	 */
 	public function channel($channel) {
+		if (!isset($channel['link'])) {
+			$channel['link'] = '/';
+		}
+		if (!isset($channel['title'])) {
+			$channel['title'] = '';
+		}
 		if (!isset($channel['description'])) {
 			$channel['description'] = '';
 		}