I'm learning kohana and I'm using ver:3.3.0.
I'm getting this error:
Kohana_HTTP_Exception [ 404 ]: The requested URL calendar was not found on this server.
SYSPATH\classes\Kohana\Request\Client\Internal.php [ 79 ]
SYSPATH\classes\Kohana\Request\Client\Internal.php [ 79 ]
SYSPATH\classes\Kohana\Request\Client.php [ 114 ] » Kohana_Request_Client_Internal->execute_request(arguments)
SYSPATH\classes\Kohana\Request.php [ 990 ] » Kohana_Request_Client->execute(arguments)
DOCROOT\index.php [ 118 ] » Kohana_Request->execute()
URL I type in:
(//localhost/organizer_tst/calendar/)
My files:
application\classes\Controller\Calendars\Calendar.php:
class Controller_Calendar extends Controller
{
public function action_index()
{
$tst = new Model_Calendar();
echo $tst->testing("LOLLOLOOLL");
}
}
application\classes\Model\calendar.php:
Class Model_Calendar extends Model
{
public function testing($param)
{
$tst ="I want to display it: "."$param";
return $tst ;
}
}
bootstrap.php:
Kohana::init(array(
'base_url' => '/organizer_tst/',
));
Route::set('something', 'calendar(/<directory>(/<controller>(/<action>(/<id>))))')
->defaults(array(
'directory' => 'Calendars',
'controller' => 'Calendar',
'action' => 'index',
));
Route::set('default', '(<controller>(/<action>(/<id>)))')
->defaults(array(
'controller' => 'welcome',
'action' => 'index',
));
I checked "Environment->included files" on error page I can see my controller file: APPPATH\classes\Controller\Calendars\Calendar.php
Everything is working if Controller is not in an extra directory in this case : application\classes\Controller\Calendars\Calendar.php
I use Xampp my root directory: D:\xampp\htdocs and I have alias to my project: Alias /organizer_tst/calendar "D:\xampp\htdocs\organizer_tst"
Can you please tell me why I have this error exception?
Kohana's naming conventions tell you how you should name and locate your classes.
In this case Kohana is looking for a class named
Controller_Calendars_Calendar
in locationapplication/classes/Controller/Calendars/Calendar.php
. It finds the file but not the class. You should name your classController_Calendars_Calendar
or move the file toapplication/classes/Controller/Calendar.php