Jump to content

Walter471

Members
  • Posts

    2
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Walter471's Achievements

Newbie

Newbie (2/6)

0

Reputation

  1. Thanks for the solution.. Regards, Walter
  2. Hi. I'm have used $page->if several times and find it quite useful. Today I tried to output some string depend on date field, like setViewData([ 'news' => $news->explode(function ($news_item) { return WireData([ 'title' => $news_item->title, 'date' => $news_item->if('publish_from=today', 'yes', 'no'), 'link' => $news_item->url ]); }) ]); It returns 'no' for all items, but it should return yes for some of them. I have tested it with 'created' field and it also doesn't work pages('id>1000')->each(function ($item) { d(date("Y-m-d", strtotime('today'))); d(date("Y-m-d", $item->created), $item->if('created=today', 'yes', 'no')); }); Should I consider it as a bug and open an issue or I miss something and didn't understand the description of $key argument for $page->if() ? Regards.
×
×
  • Create New...