php - Overwrite controller from vendors -


i`m have bundle in project vendors. necessary overwrite editcontroller class. vendor bundle build cedriclambardot admingeneratorbundle. overwrite *-generator.yml , pointed params.bundle_name name vendor bundle. owerrite controller too, him dont work, same symfony using controller vendor.

editcontroller.php vendor:

namespace acme\productbundle\controller\product;  use admingenerated\acmeproductbundle\baseproductcontroller\editcontroller baseeditcontroller; // ...  class editcontroller extends baseeditcontroller {     // ... } 

overwrited editcontroller.php

namespace acme\anniproductbundle\controller\product;  use acme\productbundle\controller\product\editcontroller baseeditcontroller; // ...  class editcontroller extends baseeditcontroller {     // ... } 

my overwrited *-generator.yml:

generator: admingenerator.generator.doctrine_odm params:   model: acme\anniproductbundle\document\product   namespace_prefix: acme   bundle_name: productbundle   object_actions:         delete: ~   fields:     name:       label: name     # ...   # ... 

my routes:

acme_productbundle_product_list:     path:      /product/     defaults:  { _controller: acmeanniproductbundle:product\list:index }  acme_productbundle_product_filters:     path:      /product/filter     defaults:  { _controller: acmeanniproductbundle:product\list:filter }  acme_productbundle_product_edit:     path:      /product/{pk}/edit     defaults:  { _controller: acmeanniproductbundle:product\edit:index }  acme_productbundle_product_update:     path:      /product/{pk}/update     defaults:  { _controller: acmeanniproductbundle:product\edit:update }  acme_productbundle_product_object:     path:      /product/{pk}/{action}     defaults:  { _controller: acmeanniproductbundle:product\actions:object }  acme_productbundle_product_new:     path:      /product/new     defaults:  { _controller: acmeanniproductbundle:product\new:index }  acme_productbundle_product_create:     path:      /product/create     defaults:  { _controller: acmeanniproductbundle:product\new:create } 

what doing wrong?

couple of options.

  1. check routes set. in routes.yml file somewhere. adjust routes point controllers.

  2. if step 1 not feasible try bundle inheritance: http://symfony.com/doc/current/cookbook/bundles/inheritance.html

if neither of these approaches work need more details. might check bundle documentation hints. it's possible controllers might sending out events in turn might mean don't have override them @ all.


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -