/** * Crea il blocco HTML standard coni dati di creazione/modifica e il pulsante di eliminazione: * * <p class="created">Creat... il ... da <strong>...</strong></p><br /> * <p><br /> * <form id="...-delete-form" action="..." method="post"><br /> * <input type="hidden" name="_csrf" value="..."><br /> * <input type="hidden" name="Delete...[...]" value="..."><br /> * <a class="btn btn-danger" href="/"><i class="fa fa-trash-o"></i> ...</a><br /> * </form><br /> * </p> * * La form ha id "{nome classe minuscolo}-delete-form", il campo nascosto ha nome "{nome classe}[{nome campo pk}]" * e valore della chiave primaria del modello. * * @param string $pkField Nome del campo pk del modello * @param string $buttonLabel Testo del pulsante di eliminazione * @param boolean $isFemale True per indicare che l'oggetto รจ al femminile * @return string Blocco HTML */ public function getCreatedUpdatedBlock($pkField, $buttonLabel, $isFemale = false) { if ($this->isNewRecord) { return; } return $this->getCreatedUpdatedParagraph($isFemale) . \PHP_EOL . Html::beginTag('p') . \PHP_EOL . Html::beginForm('', 'post', ['id' => strtolower($this->formName()) . '-delete-form']) . \PHP_EOL . Html::hiddenInput("Delete{$this->formName()}[{$pkField}]", $this->{$pkField}) . \PHP_EOL . Html::faa('trash-o', $buttonLabel, ['/'], ['class' => 'btn btn-danger']) . \PHP_EOL . Html::endForm() . \PHP_EOL . Html::endTag('p'); }
public function run() { echo Html::beginTag('div', ['class' => 'workinprogress']); echo Html::img("/{$this->folder}/{$this->image}", ['alt' => 'work-in-progress.png']); if ($this->message) { echo Html::tag('p', $this->message, ['class' => 'workinprogress-message']); } echo Html::endTag('div'); }