Jump to content

How to find out if a urlSegment is inside a PageArray


ngrmm
 Share

Recommended Posts

i have a event-page with a table.
first column in this table is page-reference-field

how can i find out if a urlSegment matches one of the rows having the same page-reference-field (page-id)?

// all guests
$allguests = new pageArray();
foreach($page->event_guests_table as $event_guests_table_row) {
	$allguests->prepend($event_table_row->guest);
}

// echo allguests would output: 1101|1102|1103|…
// domain.tld/event/1101/

// show content if guest is in the table or redirect
if($input->urlSegment1 ~= $allguests ) {
	// show content
}
else {
	// redirect
}

 

which selector operator do i have to use? the one above does not work

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

×
×
  • Create New...