Здравствуйте.
Роутинг
http://kohanaframework.su/advanced/route_p1 на этой странице
применил к Kohana 3.3., но почему то не работает(проверил раз 10, если не больше)
сами файлы
bootstrap.phpКод:
Route::set('about', 'about')
->defaults(array(
'controller' => 'static',
'action' => 'about',
));
Route::set('contacts', 'contacts')
->defaults(array(
'controller' => 'static',
'action' => 'contacts',
));
/**
* Set the routes. Each route must have a minimum of a name, a URI and a set of
* defaults for the URI.
*/
Route::set('default', '(<controller>(/<action>(/<id>)))')
->defaults(array(
'controller' => 'page',
'action' => 'index',
));
static. php сам файл конечно находиться
application\classes\ControllerКод:
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Static extends Controller_Common {
public function action_about()
{
$content = View::factory('/pages/about');
$this->template->content = $content;
}
public function action_contacts()
{
$content = View::factory('/pages/contacts');
$this->template->content = $content;
}
} //End Static
файл шаблона
main.phpКод:
<ul>
<li><a href="<?php echo URL::site();?>">Главная</a></li>
<li> <a href="<?php echo URL::site('about'); ?>">О сайте</a></li>
<li> <a href="<?php echo URL::site('contacts');?>">Контакты</a></li>
</ul>
Работает только главная страница
две другие
Цитата:
Kohana_HTTP_Exception [ 404 ]: The requested URL about was not found on this server.
Все так как и в примере описанном на сайте, но почему то не работает(вряд ли из за разницы 3.2, между 3.3)?