CakePHP:隐藏CRUD操作(有条件)

I would like to hide a CRUD action depending on the value of a variable( if $sType->payment is true then hide it otherwise show it). This is how I am trying to do it without any success.

<?php (!$sType->payment ? $this->Html->link(__('Edit'), ['action' => 'edit', $sType->id]) : '') ?>

What am I missing? I can see with debug() that $sType->payment contains the expected value.

You missed = Replace

<?php (!$sType->payment ? $this->Html->link(__('Edit'), ['action' => 'edit', $sType->id]) : '') ?>

To

<?= (!$sType->payment ? $this->Html->link(__('Edit'), ['action' => 'edit', $sType->id]) : '') ?>