Skip to content

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

Closed
@hurtsky

Description

@hurtsky

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions