-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend ExcelController from the user project ListController #813
Comments
Maybe you put in a copy of the original ExcelBuilderAction.php.twig and add replace line 15 with: use {{ namespace }}\Controller{{ prefix ? "\\" ~ prefix : "" }}\ListController as CustomListController;
class ExcelController extends CustomListController at the top. This should trigger the symfony2 bundle inheritance and use your custom template to generate ExcelBuilder controller and the custom |
Hi @loostro First of all, thanks for your reply. I've tried your suggestion but unfortunately it does not seem to work. :( Any ideas? I can always make the change in the |
@Restless-ET thats weird.. i think you should go to symfony2 docs and study the bundle inheritance and check why this does not work.. i'm sure there is a way to use bundle inheritance to overwrite these templates |
@loostro @Restless-ET I think we might be able to solve with a simple change in the
into:
I think we have exactly what Restless-ET needs, without breaking anything inside the bundle for others. I've tried it in my development environment and nothings breaks, but I do not have the usage as described in this ticket. @Restless-ET: Can you test this solution? If this works, I can create a PR for all branches. @loostro, what's your opinion? |
@loostro I find that awkward as well since I've already used that method to override |
@bobvandevijver That does indeed work, I've already tried that before. I was just trying to find another solution because I didn't know if that would be a wanted/desired change on the bundle main repository code. But if that change is ok by @loostro I don't mind create the PRs as well. |
@Restless-ET Please take a look at this doc, you're probably missing the However, I still think that the code change is nice to do, as this is the only template which extends an action from the bundle itself (in this way at least). |
Ohh.. I see.. now it works. :-) Thanks @bobvandevijver Also, 👍 for the code change on the bundle. |
Hi there,
Is there a way for the generated
ExcelController
to extend from the user projectListController
class instead of using the baseListController
created on thecache
folder?As this is right now.. if we override, for instance, the
processQuery($query)
orprocessFilters($query)
method on ourListController
class those changes won't be taken in consideration by theExcelController
thus forcing us to either:ExcelController
by copying all the functions from the generated one on our custom project and make it extend ourListController
(thus making the excel builder in our*-generator.yml
file obsolete );ListController
into ourExcelController
class ( thus having to maintain the same code in two different places :\ ).Any ideas @loostro , @bobvandevijver ?
Regards
The text was updated successfully, but these errors were encountered: