CodeIgniter Forums

Full Version: Why View Parser Filter not working on Loop Substitutions ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, i try to make template with view parser ci4

in my case, i have data example like this :
Code:
$data=['blog_entries' => [
                   ['post' => '2020-02-02']
];
 
and i want to change date format to 'd-m-Y' using filter view parser

 
Code:
{blog_entries}
        <div>{post|date(d-m-Y)}</div>
{/blog_entries}

But it doesnt work
Your missing the quotes on the date.

Code:
{blog_entries}
        <div>{post|date('d-m-Y')}</div>
{/blog_entries}

Try that if it doe's not work then something else is wrong, hard to tell without see more of the code.
(07-12-2020, 08:20 AM)InsiteFX Wrote: [ -> ]Your missing the quotes on the date.

Code:
{blog_entries}
        <div>{post|date('d-m-Y')}</div>
{/blog_entries}

Try that if it doe's not work then something else is wrong, hard to tell without see more of the code.
I am just starting to try CI4 and I ran into the same problem. And - no, the problem is not with the quotes, the same filter works fine without quotes if out of the loop. And the loop works fine if the date filter is not applied on the date.