Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ViewRenderer#extractControllerName not specify what happens nested controller namespace #64

Open
kamarton opened this issue Oct 13, 2022 · 0 comments

Comments

@kamarton
Copy link
Contributor

What steps will reproduce the problem?

My class with namespace: MyApp\AllControllers\MoreController\MyController. In this case, how does the views namespace?

  • more-controller\my OR
  • my

/**
* Returns a controller name based on controller instance.
*
* Name should be converted to "id" case without `controller` on the ending.
*
* If namespace does not contain `controller` or `controllers` then the method returns only classname without
* `controller` at the end else it returns all sub-namespaces with `controller` (or `controllers`) at the end.
*
* @param object $controller The controller instance.
*
* @return string The controller name.
*
* @example App\Controller\FooBar\BazController -> foo-bar/baz
* @example App\Controllers\FooBar\BazController -> foo-bar/baz
* @example Path\To\File\BlogController -> blog
*
* @see Inflector::pascalCaseToId()
*/
private function extractControllerName(object $controller): string

What is the expected result?

IMO my

What do you get instead?

  • I haven't tested how the code works at the moment.
  • no documented

Additional info

Q A
Version 5.0.?
PHP version -
Operating system -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant