I found following code in a project:
<?php echo $this->getToolbarHtml(); ?>
<?php // List mode ?>
<?php if($this->getMode()!='grid'): ?>
<?php $_iterator = 0; ?>
I thought it is ugly and replaced it with this:
echo $this->getToolbarHtml();
// List mode
if($this->getMode() != 'grid') {
$_iterator = 0;
}
But this rendered the code useless and the page does not load as expected anymore.
If I replace
if($this->getMode() != 'grid') {
$_iterator = 0;
}
with
if($this->getMode() != 'grid'):
$_iterator = 0;
Then the site works again. So I thought that it is a ternary operator and changed the logic to this:
if($this->getMode() != 'grid') {
//$_iterator = 0;
} else {
$_iterator = 0;
}
But the page still does not load as expected.
What exactly is the :
doing?