hi,
first of all: sorry for my englisch!
i would like realsies following url's:
www.domain.com
www.domain.com/somecategoriename/
www.domain.com/some-produkt-name.htm
So without show the controller and the view in the URL.
My current solution:
routes.php conf. for PageController:
Router::connect('/*', array('controller' => 'page', 'action' => 'index'));
PageController(nicht zu verwechseln mit PagesController):
<?php
App::uses('AppController', 'Controller');
class PageController extends AppController {
public function index(){
if(empty($this->request['pass'])){
//prepare $datas for Startpage and give them to the View
$this->set('datas', $datas);
}
if(isset($this->request['pass'][0])){
//prepare $datas for Categorie Page and give them to the
View
$this->set('datas', $datas);
}
if(isset($this->request['pass'][0]) &&
isset($this->request['ext'])){
//prepare $datas for Artikel Page and give them to the View
$this->set('datas', $datas);
}
}
}
?>
The page controller works. The startpage, category URL and the article URL i
can catch and pass the data for the view.
routes.php for AdminController:
Router::connect('/admin/*', array('controller' => 'admin', 'action' =>
'index'));
Router::connect('/users/login/*', array('controller' => 'users', 'action' =>
'login'));
AdminController:
<?php
App::uses('AppController', 'Controller');
class AdminController extends AppController {
public $components = array(
'Auth'=> array(
'authenticate' => array(
'Form' => array(
'fields' => array('username' => 'User.username', 'password'
=> 'User.password')
)
)
)
);
public function index(){
$this->test();
}
public function test(){
$this->autoRender = false;
$this->index();
}
}
?>
However, I have a
problem if I want to route into the admin area. About the index action
will all be controlled. All other actions will receive a autoRender =
false. They serve only for data processing.
Error output from server:
===========================================================
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to
complete your request.
Please contact the server administrator, [no address given] and inform
them of the time the error occurred, and anything you might have done
that may have caused the error.
More information about this error may be available in the server error log.
==========================================================
Can i solve the problem differently or what is my false?
Need help. Your answer could be both in English and in German.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php