您需要设置nestingLabel
模板:
echo $this->Form->input('condition_access', [ 'type' => 'radio', 'options' => [ ['value' => 1, 'text' => __('Free Access')], ['value' => 2, 'text' => __('Payment Access')], ['value' => 3, 'text' => __('Reduce price')] ], 'templates' => [ 'nestingLabel' => '{{hidden}}{{input}}', 'radioWrapper' => '{{label}}' ] ]);
输出: