• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why View Parser Filter not working on Loop Substitutions ?

#1
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
Reply

#2
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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#3
(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.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.