Cakephp routes prefix

前端 未结 2 1666
春和景丽
春和景丽 2021-01-28 14:06

I have 3 diferent layouts for my application related to diferent parts of content. I vould like to define my url-s so they would have the part in the begining ex. \"mypage.com/p

2条回答
  •  萌比男神i
    2021-01-28 14:36

    read below url

    For CakePHP 2.x http://book.cakephp.org/2.0/en/development/routing.html#prefix-routing

    For CakePHP 1.x http://bakery.cakephp.org/articles/Frank/2009/11/02/cakephp-s-routing-explained

    Or

    Configure::write('Routing.prefixes', array('admin', 'manager'));
    
    $this->connect("/{$prefix}/:plugin/:controller", array('action' => 'index', 'prefix' => $prefix, $prefix => true));
    $this->connect("/{$prefix}/:plugin/:controller/:action/*", array('prefix' => $prefix, $prefix => true));
    Router::connect("/{$prefix}/:controller", array('action' => 'index', 'prefix' => $prefix, $prefix => true));
    Router::connect("/{$prefix}/:controller/:action/*", array('prefix' => $prefix, $prefix => true));
    

提交回复
热议问题