manuelBetancurt
manuelBetancurt

Reputation: 16128

Zend from a view to another view

Im a Zend Noob,

I have it working showing the default index page [local]

http://myzftest.test/zend_template/public/

I have created another view for my controller called about; I can see this view if I go to

http://myzftest.test/zend_template/public/about

Now my noob question,

If I want to navigate from one view [index] to my other view [about]

how to proceed?

Im doing it like normal html:

<A HREF="./about">my about page</A>

Is this correct or is there a Zend way ?

thanks

Upvotes: 0

Views: 43

Answers (1)

simplyray
simplyray

Reputation: 1200

just use url() viewhelper inside your *.phtml view file:

Syntax usage:

$this->url(array(
             'controller' => '<yourcontroller>',
             'action' => '<youraction>'), 
          'default', true);

Example:

    <a href="<?php echo $this->url(array(
      'controller' => 'public',
      'action' => 'about'), 'default', true); ?>">
     my about page
   </a>

Upvotes: 3

Related Questions