Bug Report #4833

Problem with folder structure?

Added by Dai Jobou 4 months ago. Updated 3 months ago.

Status:NewStart date:04/23/2014
Priority:ImmediateDue date:
Assignee:-% Done:

0%

Category:Core
Target version:v3.3.2
Resolution: Points:1

Description

I have upgraded to v3.3.2 and (I think) I founded a bug in folder structure.

My Controller:

class Controller_Folder1_Folder2_Index extends Controller

Path:

/application/classes/Controller/Folder1/*Folder2*/index.php

My Route:

Route::set('name', 'folder1/<id>(/<controller>)', array(
'id' => '[0-9]',
'controller' => 'xxx1|xxx2'
))
->defaults(array(
'directory' => 'folder1/folder2',
'controller' => 'index'
));

Thats not working! I must rename path to:

/application/classes/Controller/Folder1/*folder2*/index.php

The second folder must be lowercase? Is this a bug?

History

#1 Updated by Dai Jobou 4 months ago

I think this bug report is invalid and must be changed to:

->defaults(array(
'directory' => 'Folder1/Folder2',
'controller' => 'Index'
));

Its a little confusing, that "controller" default section must be uppercase and as parameter before must be lowercase. ^^

#2 Updated by Sam Wilson 3 months ago

Have a look at https://github.com/kohana/core/blob/ffc8a712a513eab004a28e9fa028f91ea67eaba4/classes/Kohana/Route.php#L448

Both the controller and directory values get words capitalized, but words are only underscore-separated, and not slash-separated.

The simple fix is to use Windows.

No no! Don't do that! I'm joking: the simple fix is as Dai wrote above, to provide the correctly-capitalised folder names. :-)

Actually, the userguide indicates that the controller name should begin with a capital letter.

If any further action is required for this issue, please raise a new issue on Github, as that's going to be the home for all issues from now on.

Also available in: Atom PDF