Jump to content

Is there a ProcessWire way to do this?


PWaddict
 Share

Recommended Posts

Hello, I'm outputing repeater content in ProcessWire way like this instead of the classic foreach.

<?= preg_replace('/(.*),/','$1 &', $page->datetimes->implode(", ", "{day} {time_start}-{time_end}"))
// Monday 19:00-21:00, Tuesday 19:00-21:00 & Wednesday 19:00-21:00 ?>

Is there a ProcessWire way to output the content like below where if the time_start and time_end have the same values on all days then display them only once at the end of the string:

Monday, Tuesday & Wednesday 19:00-21:00

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...