开发者

Good way to initialize pages using Zend_Navigation

i am reading up on zend navigation and was wondering whats good way to set it up.

Where do i setup up? can i do it using application.ini - but 开发者_运维知识库it may make application.ini too long to read. maybe using a resource method? maybe a plugin?

do i hardcode all pages? eg.

$pages = array(
  array(
    'label' => 'Home',
    'title' => 'Home page title',
    'controller' => 'index',
    'action' => 'index'
  ),
  array(
    'label' => 'Blog',
    'title' => 'Blog',
    'controller' => 'index',
    'action' => 'blog',
    'pages' => array(
      array(

in a dynamic site it seems smarter to generate this database, eg. child pages of blog will be generated from blog categories? except i want to only do it once? maybe i must cache it? i must make sure tho that if new categories were added, the navigation also updates.


To make it so you can add new pages from a CMS ex. Would I have put this in your database model. The Zend to create a function to return an array of categories and pages. Ex.

$Tools->GetTreeOfPagesAndCategories();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜