Open denys281 opened 10 years ago
@denys281 please post the beggining of your generator.yml
file (bundle name, namespace prefix, etc)
@loostro
Bundle in Webmil/Backend/StaticBundle
generator: admingenerator.generator.doctrine
params:
model: Webmil\Frontend\StaticBundle\Entity\StaticData
namespace_prefix: Webmil
concurrency_lock: ~
bundle_name: Backend\StaticBundle
pk_requirement: ~
fields: ~
object_actions:
delete: ~
batch_actions:
delete: ~
Ok, in Generator.php
I try change
return $this->cache_dir.'/Admingenerated/'.str_replace('\\', DIRECTORY_SEPARATOR, $namespace).$bundle_name;
to
return $this->cache_dir.'/Admingenerated/'.str_replace('\\', DIRECTORY_SEPARATOR, $namespace).str_replace('\\', DIRECTORY_SEPARATOR, $bundle_name);
And in start generate folder in cache like AcmeBackend/StaticBundle
, but I have next error
FatalErrorException: Error: Call to undefined method Acme\Backend\StaticBundle\Form\Type\Static\FiltersType::setSecurityContext() in /home/dan/WEB/www/project/app/cache/dev/Admingenerated/AcmeBackend/StaticBundle/BaseStaticController/ListController.php line 425
_Update_: it generate wrong namespace in FiltersType.php
:
use Admingenerated\AcmeBackendStaticBundle\Form\BaseStaticType\FiltersType as BaseFiltersType;
I fix it manually and next error:
Unable to find template "AcmeBackend\StaticBundle:StaticList:index.html.twig".
@denys281 what happens if you try:
generator: admingenerator.generator.doctrine
params:
model: Webmil\Frontend\StaticBundle\Entity\StaticData
namespace_prefix: Webmil\Backend # added Backend
bundle_name: StaticBundle # removed Backend
@loostro
Opps an error occurred in your configuration. If you're in prod try cache:warmup
Can you try also with double slashes Webmil\\Backend
? And clear your cache to be sure everything is regenerated.
same error.
Hmm.. just to be sure it's not escapeing characters problem, please try also with 3 \\\
and 4 \\\\
slashes.
Same error.
Ok, the line
return $this->cache_dir.'/Admingenerated/'.str_replace('\\', DIRECTORY_SEPARATOR, $namespace).$bundle_name;
is fine, but something else is throwing an error and you get the EmptyBuilder generated...
I've faced the same problem. Followed the official documentation at http://symfony2admingenerator.org/documentation/generator-params.html# and find out the param (subfolder) in generator.yml, that helps in a custom namespace tree. My generator.yml looks now like this:
generator: admingenerator.generator.doctrine
params:
model: Company\Bundle\AdminBundle\Entity\MyEntity
namespace_prefix: Company
subfolder: Bundle
bundle_name: AdminBundle
When I have bundle for example
Acme/Backend/BlogBundle
. On any action of this bundle symfony give 500.But
Acme/BackendBlogBundle
works perfect.Stack Trace
Problem is that in
cache
Admingenerator generate folder with nameAcmeBackend\BlogBundle