1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
|
public function init() {
$this->_helper->contextSwitch()
->addContext(
'txt', array('suffix'=>'txt', 'headers'=>array('Content-Type'=>'text/plain'))
)
->addActionContext('robots','txt')
->addActionContext('sitemap','xml')
->initContext();
}
public function indexAction () {
$this->_helper->layout()->disableLayout();
//$this->_helper->viewRenderer->setNoRender(true);
$pages = array(
array(
'label' => 'Home',
'title' => 'Home',
'module' => 'default',
'controller' => 'index',
'action' => 'index',
'order' => -100, // make sure home is the first page
'lastmod' => '2010-06-29T08:15:30-08:00',
'changefreq' => 'daily',
'priority' => '1'
),
array(
'label' => 'Bands',
'module' => 'default',
'controller' => 'band',
'action' => 'list',
'visible' => true,
'lastmod' => '2010-06-29T08:15:30-08:00',
'changefreq' => 'daily',
'priority' => '1'
),
array(
'label' => 'Assets',
'module' => 'default',
'controller' => 'asset',
'action' => 'list',
'visible' => true,
'lastmod' => '2010-06-29T08:15:30-08:00',
'changefreq' => 'daily',
'priority' => '1'
),
array(
'label' => 'Venues',
'module' => 'default',
'controller' => 'venue',
'action' => 'list',
'visible' => true,
'lastmod' => '2010-06-29T08:15:30-08:00',
'changefreq' => 'daily',
'priority' => '1'
),
array(
'label' => 'Help',
'module' => 'default',
'controller' => 'content',
'action' => 'help',
'visible' => true,
'lastmod' => '2010-06-29T08:15:30-08:00',
'changefreq' => 'monthly',
'priority' => '0.8'
)
);
$container = new Zend_Navigation($pages);
$this->view->navigation($container);
}
VIEW index.phtml
<?
echo $this->navigation()->sitemap();
?>
|