0

I try to create custom block and controller in my frontend theme folder. But is it allowed to have controllers and blocks in my frontend theme folders? Like: app\design\frontend\Myvendor\and-my-themename\Block or app\design\frontend\Myvendor\and-my-themename\Controller ?

Or do I have to create a second folder in app\code\Mevendor\Customcontroller\?

2 Answers 2

1

No. You need to create extension for it. You can use controller and block in extension. Not in theme.

0
0

If you need to used any block or controller in theme, then you need to create one custom extension.

In that extension you need to overide block or create controller and used that block file or controller function in your phtml file according to your requirement.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.