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

[BUG]: The routing controller name changes when using syntax sugar. #15067

Closed
fagai opened this issue Jun 1, 2020 · 1 comment · Fixed by #15770
Closed

[BUG]: The routing controller name changes when using syntax sugar. #15067

fagai opened this issue Jun 1, 2020 · 1 comment · Fixed by #15770
Assignees
Labels
5.0 The issues we want to solve in the 5.0 release breaks bc Functionality that breaks Backwards Compatibility bug A bug report status: low Low

Comments

@fagai
Copy link

fagai commented Jun 1, 2020

Example

$eventsManager->attach(
    "dispatch:beforeDispatch",
    function(\Phalcon\Events\Event $event, \Phalcon\Mvc\Dispatcher $dispatcher) {
        log($dispatcher->getControllerName());
    }
);
$router->add('hoge/huga', ['controller' => 'HogeHoge', 'action' => 'huga'];
// controller_name: HogeHoge
$router->add('hoge/huga', ['controller' => 'hoge-hoge', 'action' => 'huga'];
// controller_name: hoge-hoge

$router->add('hoge/huga', 'HogeHoge::huga'];
// controller_name: hoge_hoge

The operation is different when passing in an array and passing in a string.
Because it is uncamelize by the following process.

let routePaths["controller"] = uncamelize(realClassName);

Although it is a syntax sugar, the processing is different...

@fagai fagai added bug A bug report status: unverified Unverified labels Jun 1, 2020
@zsilbi zsilbi added breaks bc Functionality that breaks Backwards Compatibility 6.0 The issues we want to solve in the 6.0 release and removed status: unverified Unverified labels Sep 10, 2020
@zsilbi zsilbi added the transfer label Oct 6, 2020
@Jeckerson Jeckerson added 5.0 The issues we want to solve in the 5.0 release and removed 6.0 The issues we want to solve in the 6.0 release transfer labels Mar 30, 2021
BeMySlaveDarlin pushed a commit to BeMySlaveDarlin/cphalcon that referenced this issue Nov 7, 2021
BeMySlaveDarlin pushed a commit to BeMySlaveDarlin/cphalcon that referenced this issue Nov 7, 2021
BeMySlaveDarlin pushed a commit to BeMySlaveDarlin/cphalcon that referenced this issue Nov 7, 2021
@BeMySlaveDarlin BeMySlaveDarlin self-assigned this Nov 7, 2021
@BeMySlaveDarlin BeMySlaveDarlin linked a pull request Nov 7, 2021 that will close this issue
5 tasks
@niden niden added this to Working on it in Phalcon Roadmap Nov 7, 2021
@niden niden added the status: low Low label Nov 7, 2021
@niden
Copy link
Sponsor Member

niden commented Nov 7, 2021

Resolved in #15770

@niden niden closed this as completed Nov 7, 2021
Phalcon Roadmap automation moved this from Working on it to Implemented Nov 7, 2021
BeMySlaveDarlin pushed a commit to BeMySlaveDarlin/cphalcon that referenced this issue Nov 7, 2021
@niden niden moved this from Implemented to Released in Phalcon Roadmap Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 The issues we want to solve in the 5.0 release breaks bc Functionality that breaks Backwards Compatibility bug A bug report status: low Low
Projects
Archived in project
Phalcon Roadmap
  
Released
Development

Successfully merging a pull request may close this issue.

6 participants