Closed ruffiem closed 8 years ago
Hey Sam,
Here we go :
Tables
CREATE TABLE `test_with_underscore` (
`idtest` int(11) NOT NULL,
`coltest` varchar(45) DEFAULT NULL,
`coltest1` varchar(45) DEFAULT NULL,
PRIMARY KEY (`idtest`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `testnounder` (
`idtest` int(11) NOT NULL,
`coltest` varchar(45) DEFAULT NULL,
`coltest1` varchar(45) DEFAULT NULL,
PRIMARY KEY (`idtest`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `test_underscore` (
`idtest` int(11) NOT NULL,
`coltest` varchar(45) DEFAULT NULL,
`coltest1` varchar(45) DEFAULT NULL,
PRIMARY KEY (`idtest`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Model generator
Data from automation :
CRUD generator
Example for test_with_underscore :
Links
Data
No sample data.
Thanks!
I can take care of it if you want ^^
Yes, that would be great.
I'm on it. Were you able to reproduce the issue ? Or anyone else out there ?
I haven't tried yet.
I have the same issue. Is there a solution for this?
I couldn't reproduce the bug. I presume he is using wrong controller IDs in url: testUnderscore must be test-underscore and testWithUnderscore must be test-with-underscore.
Hi... i have the same issue do i have to add underscore in controller and view folder?
Here is my stack trace:
`yii\base\InvalidRouteException: Unable to resolve the request "tfinxmlsri/index". in C:\xampp\htdocs\facturas_seted\vendor\yiisoft\yii2\base\Module.php:532 Stack trace:
Next yii\web\NotFoundHttpException: Página no encontrada. in C:\xampp\htdocs\facturas_seted\vendor\yiisoft\yii2\web\Application.php:114 Stack trace:
@jeicd 's right!
The controller id must be delimiter with -
symbol, because here https://github.com/yiisoft/yii2/blob/master/framework/base/Module.php#L631 controller id will be exploded and will uppercased first letter.
If you wanna use camelCase in your routes, you can write url rules like this 'testWithUnderscore/<action:\w+>' => 'test-with-underscope/<action>',
If you wanna use camelCase in path to your views, just set viewPath
in controller like this:
$this->viewPath = $this->module->getViewPath() . DIRECTORY_SEPARATOR . 'testWithUnderscore';
or you can override getViewPath
method.
to @sucoec @wildgras @ruffiem
I fooled around and created 3 tables :
test_with_underscore test_underscore testnoscore
The generators creates the files correctly for all 3 tables but when I try to access the page, only testnoscore shows up. The other two show an error, for test_underscore it will be :
The DB is MySQL and the table scheme has 3 elementary columns (id, col1, col2).