PHP Classes

File: crud/default/views/update.php

Recommend this page to a friend!
  Classes of Insolita   Yii2 Giitwig   crud/default/views/update.php   Download  
File: crud/default/views/update.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Yii2 Giitwig
Implement CRUD applications using Twig templates
Author: By
Last change:
Date: 2 months ago
Size: 982 bytes
 

Contents

Class file image Download
<?php

use yii\helpers\Inflector;
use
yii\helpers\StringHelper;

/* @var $this yii\web\View */
/* @var $generator insolita\giitwig\crud\Generator */

$urlParams = $generator->generateTwigUrlParams();

?>
{{ set(this,'title',<?= $generator->generateString('Update {modelClass}:', ['modelClass' => Inflector::camel2words(StringHelper::basename($generator->modelClass))]) ?> ~ model.<?= $generator->getNameAttribute() ?>) }}

{{ set(this, 'params', { 'breadcrumbs' : [
          { 'label' : <?= $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>, 'url':['index'] },
          { 'label' : model.<?= $generator->getNameAttribute() ?>,'url':url('view',<?= $urlParams ?>) },
          { 'label' : this.title }
     ]
   })
}}

<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-update">

    <h1>{{this.title}}</h1>
    {{ this.render('_form.twig',{'model':model})|raw }}
</div>