Skip to content
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

feat: add Config\View::$enableConditionals to disable Parser conditionals #5841

Closed

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Mar 30, 2022

Description
Fixes #5831

CI3 Parser does not have conditionals. See https://codeigniter.com/userguide3/libraries/parser.html
CI4 Parser has conditionals, and it is difficult to distinguish if there is JavaScript code in templates.

  • add Config\View::$enalbeConditionals to disable Parser conditionals
    • The setting is for compatibility with templates that works on CodeIgniter3.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added enhancement PRs that improve existing functionalities bug Verified issues on the current code behavior or pull requests that will fix them labels Mar 30, 2022
@kenjis kenjis force-pushed the feat-parser-enalbeConditionals branch from 48e681f to 9ca1c85 Compare March 30, 2022 08:38
@kenjis kenjis force-pushed the feat-parser-enalbeConditionals branch from 9ca1c85 to 96ecc6b Compare March 30, 2022 08:50
Copy link
Contributor

@totoprayogo1916 totoprayogo1916 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a typo?
enable or enalbe?

ah my bad :(

@kenjis kenjis force-pushed the feat-parser-enalbeConditionals branch from 96ecc6b to 6702500 Compare March 31, 2022 01:07
@kenjis
Copy link
Member Author

kenjis commented Mar 31, 2022

@totoprayogo1916 Thanks! These are typos. Fixed.

@kenjis kenjis changed the title feat: add Config\View::$enalbeConditionals to disable Parser conditionals feat: add Config\View::$enableConditionals to disable Parser conditionals Mar 31, 2022
@kenjis
Copy link
Member Author

kenjis commented Mar 31, 2022

I found another solution: #5842
This PR might not to be needed.

@kenjis
Copy link
Member Author

kenjis commented Apr 2, 2022

#5842 was merged, so I think this is not needed.

@kenjis kenjis closed this Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them enhancement PRs that improve existing functionalities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: View parser throws view exception with nested 'if' within javascript code
2 participants