/**
  * Updates an existing Post model.
  * If update is successful, the browser will be redirected to the current page.
  * @param integer $id
  * @return mixed
  */
 public function actionUpdate($id)
 {
     $model = $this->findModel($id);
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(Url::current());
     } else {
         return $this->render('update', ['model' => $model, 'langList' => Lang::getList()]);
     }
 }
Exemplo n.º 2
0
?>
</title>
    <?php 
$this->head();
?>
</head>
<body>
<?php 
$this->beginBody();
?>

<div class="wrap">
    <?php 
NavBar::begin(['brandLabel' => Yii::t('app', 'Yii2 Documentation'), 'brandUrl' => ['/site/index'], 'options' => ['class' => 'navbar-default', 'style' => 'margin-bottom: 0;']]);
echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-left'], 'items' => [['label' => Yii::t('app', 'Backend'), 'url' => '/admin']]]);
$langHelper = new LangHelper(['langs' => Lang::getList(true)]);
echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-right'], 'items' => [['label' => $langHelper->langs[$langHelper->currentLang], 'items' => $langHelper->getList()], ['label' => $gitHubLogo . 'GitHub', 'url' => 'https://github.com/LAV45/yii2-translated-behavior', 'linkOptions' => ['target' => '_blank'], 'encode' => false]]]);
NavBar::end();
?>
    <main class="jumbotron" role="main" style="margin-bottom: 0;">
        <div class="container text-center">
            <h1>Yii2 translated behavior</h1>
            <p class="lead">
                <?php 
echo Yii::t('app', 'This extension helps you to quickly add the ability to translate your website.');
?>
            </p>
            <p>
                <img alt="Latest Stable Version" src="https://poser.pugx.org/lav45/yii2-translated-behavior/v/stable">
                <img alt="Total Downloads" src="https://poser.pugx.org/lav45/yii2-translated-behavior/downloads">
                <img alt="Code Coverage" src="https://scrutinizer-ci.com/g/lav45/yii2-translated-behavior/badges/coverage.png?b=master">