title: Yii2:Custom form Title
body: <p>In my _form.php I am trying to change the default form title. </p>
  
  <p>Actually what I want to change the text in Bold -<strong>Create City</strong> to <strong>Create Custom City</strong></p>
  
  <p>To achieve this I am trying this code, but I am getting the error like - Unable to locate message source for category 'City'.</p>
  
  <p>example1</p>
  
  <pre><code>&lt;?php
  $this-&gt;title = Yii::t('City','Custom City');
  ?&gt;
  </code></pre>
  
  <p>example 2- I am not getting any error, but the form title is also not changed.</p>
  
  <pre><code>&lt;?php
  $this-&gt;title = 'Custom City';
  ?&gt;
  </code></pre>
  
  <p>I am putting below the whole code of <code>_form.php</code>:</p>
  
  <pre><code>&lt;?php
  
  use yii\helpers\Html;
  use yii\widgets\ActiveForm;   
  
  /* @var $this yii\web\View */
  /* @var $model app\models\City */
  /* @var $form yii\widgets\ActiveForm */
  
  $this-&gt;title = ('Custom City');
  
  $this-&gt;params['breadcrumbs'][] = $this-&gt;title;
  ?&gt;
  
  
  
  &lt;div class="row"&gt;
      &lt;div class="col-lg-3"&gt;
  
      &lt;/div&gt;
      &lt;div class="col-lg-5 col-lg-offset-1"&gt;
      &lt;div class="city-form"&gt;
  
          &lt;?php $form = ActiveForm::begin(); ?&gt;
  
          &lt;?= $form-&gt;field($model, 'state_id')-&gt;DropDownList(ArrayHelper::map(State::find()-&gt;all(), 'id', 'state_name' ),
      [ 'prompt' =&gt; 'Please Select' ])?&gt;
  
          &lt;?= $form-&gt;field($model, 'city_name')-&gt;textInput() ?&gt;
  
          &lt;div class="form-group"&gt;
              &lt;?= Html::submitButton($model-&gt;isNewRecord ? 'Create' : 'Update', ['class' =&gt; $model-&gt;isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?&gt;
          &lt;/div&gt;
  
          &lt;?php ActiveForm::end(); ?&gt;
  
      &lt;/div&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/j4f9l.jpg" alt="City form view"></p>