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

There is no way to specify default action with annotation @Route('/') #1608

Closed
baryshev opened this issue Nov 28, 2013 · 1 comment
Closed
Labels
bug A bug report status: medium Medium

Comments

@baryshev
Copy link
Contributor

This code tries to add null route and application fails with error 'The pattern must be string' if RoutePrefix annotation is not used and Route annotation value is '/'.

I't makes impossible to point all application routes with annotations. I think we need special rule for this situation. Like this:

if (Z_TYPE_P(value) != IS_NULL) {
        if (!PHALCON_IS_STRING(value, "/")) {
                PHALCON_INIT_VAR(uri);
                PHALCON_CONCAT_VV(uri, route_prefix, value);
        } else {
                if (Z_TYPE_P(route_prefix) != IS_NULL) {
                        PHALCON_CPY_WRT(uri, route_prefix);
                } else {
                        PHALCON_CPY_WRT(uri, value);
                }
        }
} else {
        PHALCON_INIT_NVAR(uri);
        PHALCON_CONCAT_VV(uri, route_prefix, action_name);
}
phalcon pushed a commit that referenced this issue Apr 16, 2014
Fix #1608 about Phalcon\Mvc\Router\Annotations
@niden niden closed this as completed in 5073d03 Jun 4, 2014
@baryshev
Copy link
Contributor Author

baryshev commented May 6, 2015

It's back in 2.0

baryshev added a commit to baryshev/cphalcon that referenced this issue May 7, 2015
andresgutierrez added a commit that referenced this issue May 9, 2015
Fix #1608 about Phalcon\Mvc\Router\Annotations
@niden niden added bug A bug report status: medium Medium and removed Bug - Medium labels Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: medium Medium
Projects
None yet
Development

No branches or pull requests

2 participants