How to receive extra variable from CHtml::submitButton

Hey guys,

this question may be stupid, but I just can’t figure out how to make it work.

I’m sending an extra variable via the CHtml::submitButton like this:

echo CHtml::submitButton('Create', array('entry_id' => $entry->entry_id)); 

How can I receive the value in the controller of "entry_id"?

Thanks in advance,


It’s not an extra variable, but an html option. You should do smth like this:

echo CHtml::activeHiddenField($entry, 'entry_id');

Thanks a lot andy, solved it before with

<input type="hidden" name="entry_id" value="<?php echo $entry->entry_id;?>" />

but now i’ve choosen the “Yii-way” :slight_smile: