Hi,
I have a file field in the _form.php used by both add.php and edit.php
<?php echo $form->labelEx($model,'ImageFileName'); ?>
<?php echo $form->fileField($model,'ImageFileName'); ?>
<?php echo $form->error($model,'ImageFileName'); ?>
In the add state, the form field appears nicely and I have no problem in the controller uploading the file.
But how do I make the edit page to show the uploaded file in the form of a link? (with a small delete icon beside it)
If I share the same _form.php as the add page, the edit page will show the input field minus the filename.
How to differentiate add and edit state in the _form.php?
Or should I create a separate _form_edit.php just to display the uploaded file as a link?
Thanks for helping.