Mac Story Posted September 5 Share Posted September 5 1 Link to comment Share on other sites More sharing options...
inaybs Posted September 5 Share Posted September 5 Heya! I also got the same issue with u Mr. Mac, I am trying to extend by adding a supplier name on the product list under the order details but when I do, I also get the same error message. Here is my sample extended file Link to comment Share on other sites More sharing options...
Andrei H Posted September 5 Share Posted September 5 Hello, Your problem is most likely the fact that you are using the display method, or some similar method, which should be used only for smarty templates. For twig templates, you need to use the render method. If you are in a module main file, here is the syntax that you need to use: return $this->get('twig')->render('@Modules/<module_name>/views/templates/admin/test.twig', []); You will need to replace that first argument with your information. The array is the data passed to the template. If you are in an admin controller that extends FrameworkBundleAdminController, you directly have access to the render method. Link to comment Share on other sites More sharing options...
inaybs Posted September 6 Share Posted September 6 19 hours ago, Andrei H said: Hello, Your problem is most likely the fact that you are using the display method, or some similar method, which should be used only for smarty templates. For twig templates, you need to use the render method. If you are in a module main file, here is the syntax that you need to use: return $this->get('twig')->render('@Modules/<module_name>/views/templates/admin/test.twig', []); You will need to replace that first argument with your information. The array is the data passed to the template. If you are in an admin controller that extends FrameworkBundleAdminController, you directly have access to the render method. Thanks! This one worked for me. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now