-
Notifications
You must be signed in to change notification settings - Fork 160
Magento2.Templates.HelperInTemplate Rule #121
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
Comments
diazwatson
added a commit
to diazwatson/magento-coding-standard
that referenced
this issue
Aug 1, 2019
diazwatson
added a commit
to diazwatson/magento-coding-standard
that referenced
this issue
Aug 10, 2019
diazwatson
added a commit
to diazwatson/magento-coding-standard
that referenced
this issue
Aug 12, 2019
diazwatson
added a commit
to diazwatson/magento-coding-standard
that referenced
this issue
Aug 15, 2019
lenaorobei
added a commit
to diazwatson/magento-coding-standard
that referenced
this issue
Aug 16, 2019
lenaorobei
added a commit
that referenced
this issue
Aug 16, 2019
#121 Magento2.Templates.HelperInTemplate Rule porposal
magento-devops-reposync-svc
pushed a commit
that referenced
this issue
Nov 15, 2021
…heck-array-autovivification-fix Fixed code array autovivification
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After the work done in #108 I kept wondering:
helpers
inPHTML
files?This is a proposal to answer those questions.
Rule
The use of helpers is in general discouraged. For PHTML, consider using ViewModel instead.
Reason
The use of helpers is in general discouraged therefore any
$this->helper(<helper_class>)
code used in PHTML templates should be refactored. Consider using ViewModel instead.Implementation
Typical example of a helper being used in a PHTML:
Once the ViewModel is created, call it in the PHTML as follow:
or
The text was updated successfully, but these errors were encountered: