Read only mode

Sometimes we want the site change to ready only mode. Is anyway we could do it now?

Why not just hide the edit button for a user who is not allowed to edit fields?

But if you want to show the user that, for example, a textfield is there but he is not allowed to edit it so it needs to be in "readonly" mode, just add "readonly disabled" in htmloptions:




//example if you want subject textfield to be readonly for the user if he has no access rights to do so

<div class="row">

	<?php echo $form->textField($model,'subject',array('size'=>60,'maxlength'=>128,'readonly disabled'=>'')); ?>

</div>



Thanks for your reply. Periodically we need to shut down the site for database maintenance. But sometimes we only need to block the database write, so users can still browse the site. I am looking for a solution to "globally" turn off the write, but not read, at application level.

I seeā€¦ that would be a useful feature :)