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

Bug: Parser will overwrite the value if the initial variable is same #3726

Closed
hurtsky opened this issue Oct 5, 2020 · 0 comments · Fixed by #3749
Closed

Bug: Parser will overwrite the value if the initial variable is same #3726

hurtsky opened this issue Oct 5, 2020 · 0 comments · Fixed by #3749
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@hurtsky
Copy link

hurtsky commented Oct 5, 2020

Direction
when using parser to render view, the parser can't differentiate between {expired_discount} with {expired_discount_date}

Describe the bug
Code example
Controller:

<?php

namespace App\Controllers;

class Test extends BaseController
{
	public function index()
	{
		$data = [
			'expired_discount'           => '1212312423470',
			'expired_discount_date'  => '1999-09-09',
		];
		echo $this->parser->setData($data)->render('test');
	}
}

View:

<p>Expired Discount Serial = {expired_discount}</p>
<p>Expired Discount Date = {expired_discount_date}</p>

Result:

Expired Discount Serial = 1212312423470

Expired Discount Date = 1212312423470

expired_discount_date will have the same value as expired_discount

CodeIgniter 4 version
branch: develop

Expected behavior, and steps to reproduce if appropriate
value of expired_discount should not be the same with expired_discount_date

Context

  • OS: Window 10
  • Apache 2.4.46
  • 7.4.10
@hurtsky hurtsky added the bug Verified issues on the current code behavior or pull requests that will fix them label Oct 5, 2020
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant