gii can't find custom model template


I tried to follow this tutorial for setting up a new GII generator template:

Custom Gii Template

After trying to setup my own model template I get this error:



$config['modules']['gii'] = [


			'generators' => [

				'crud' => [

					'class' => 'yii\gii\generators\crud\Generator',

					'templates' => [

						'activeString' => '@app/common/custom/giiTemplates/crud/activeString',



				'model' => [

					'class' => 'yii\gii\generators\model\Generator',

					'templates' => [

						'activeString' => '@app/common/custom/giiTemplates/model/activeString',





Obvious question, but does the class actually exist in the directory the generator is expecting? :rolleyes:

Ha! good question, actually in this case the files are there.

I think this is a classic windows vs linux file path issue.

I put the full path in and everything works fine. But if I try and use the @app alias and forward slash the rest, it craps out.

I think it’s as I am widows I should be using back slashes. ;)

This has nothing to do with paths - and yes: you need to use forward slash on Windows too.

Your generator cannot find the template file called ‘model’ - check that it is where the generator expects it to be.

Maybe you forgot to copy the file over?

Go into your model generator folder and look.