php - Symfony overwrite controller and action -
i use hwio bundle , after custom service throws in connectcontroller in public function connectserviceaction(request $request, $service)
in action throws me hwio template, know how reload template don't need template need stay rout: example have route "home_page" after social connect want still rout "home_page"
this service:
class userprovider implements oauthawareuserproviderinterface { protected $grabproject; public function __construct(ggrabgithubproject $grabproject) { $this->grabproject = $grabproject; } /** * {@inheritdoc} */ public function connect(userinterface $user, userresponseinterface $response) { $service = $response->getresourceowner()->getname(); $serviceprovider = $service."provider"; $user = $this->$serviceprovider->setuserdata($user, $response); $grabproject = $this->grabproject->grabproject($response->getaccesstoken(), $user); } }
in bundle add
class mybundle extends bundle { public function getparent() { return 'hwioauthbundle'; } }
and copy connectcontroller in directory , change logic instead render template add redirest to roting "home_page" if need overwrite controller bundle, ?
class mybundle extends bundle { public function getparent() { return 'hwioauthbundle';//how add bundle ? } }
hwioauthbundle
not have connectcontroller
defined service, need redeclare routing connectcontroller
hard coded:
- https://github.com/hwi/hwioauthbundle/blob/master/resources/config/routing/login.xml
- https://github.com/hwi/hwioauthbundle/blob/master/resources/config/routing/redirect.xml
- https://github.com/hwi/hwioauthbundle/blob/master/resources/config/routing/connect.xml
an example:
<?xml version="1.0" encoding="utf-8" ?> <routes xmlns="http://symfony.com/schema/routing" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> <route id="hwi_oauth_connect" path="/"> <default key="_controller">yourcustombundle:connect:connect</default> </route> </routes>
Comments
Post a Comment