Zend Framework - additional router labels

Most likely, I’m all about it differently. I am completely new to the structure.

The site that I am developing has two "parts" that are basically divided. Information / public half and half of the trade. I use the following directory structure:

--application
----default
------controllers
------layouts
------models
------views
----store
------controllers
------layouts
------models
------views
--config
--library
--public

I would like to have a URL structure when browsing products as follows:

/ view / category / model / version

This will pull up a specific product / revision, but I would also like to go back (view all versions, all models, etc.). I can’t figure out how to achieve this. My route is configured as follows:

Bootstrap.php

  $front = Zend_Controller_Front::getInstance();
  $router = $front->getRouter();
  $route = new Zend_Controller_Router_Route(
      'view/:cid/:sku/:rev',
      array('module' => 'store', 'controller' => 'index', 'action' => 'index')
  );
  $router->addRoute('view', $route);

, ( , ) . , 1-3 ? ?

, , . - Zend Framework, .

+3
1

ZendFramework, , . . NULL , 3 4?

, - :

$route = new Zend_Controller_Router_Route(
      'view/:cid/:sku/:rev',
      array('module' => 'store', 'controller' => 'index', 'action' => 'index', 'cid' => 0, 'sku' => 0, 'rev' => 0)
  );

, .

+4

Source: https://habr.com/ru/post/1760194/


All Articles