/**
  * @param FieldSetEvent $event
  */
 public function beforeFormRender($event)
 {
     $fieldSet = $event->fieldSet;
     $templateTab = new Tab('template', Module::t('template', 'Template'), [$fieldSet->getForm()->field($fieldSet->getModel(), 'template_id')->dropDownList(ArrayHelper::map(Template::find()->asArray()->all(), 'id', 'name'), ['prompt' => ''])->label(Module::t('template', 'Template'))]);
     $fieldSet->addItem($templateTab, 'tabs');
 }
Exemple #2
0
/* @var $model im\seo\models\Meta */
?>

<?php 
if (!isset($form)) {
    $form = ActiveForm::begin();
}
?>

<?php 
echo $this->render('@im/seo/backend/views/meta/_main', ['model' => $model, 'form' => $form]);
?>

<?php 
echo $this->render('@im/seo/backend/views/meta/_social', ['model' => $model, 'form' => $form]);
?>

<?php 
if (!isset($form)) {
    ?>
<div class="form-group">
    <?php 
    echo Html::submitButton($model->isNewRecord ? Module::t('module', 'Create') : Module::t('module', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-success']);
    ?>
</div>
<?php 
    ActiveForm::end();
}
?>

Exemple #3
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['id' => Module::t('socialMeta', 'ID'), 'meta_id' => Module::t('socialMeta', 'Meta ID'), 'social_type' => Module::t('socialMeta', 'Social Type')];
 }
Exemple #4
0
 /**
  * @inheritdoc
  */
 public function getSocialName()
 {
     return Module::t('twitterCard', 'Twitter Cards');
 }
Exemple #5
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['id' => Module::t('meta', 'ID'), 'entity_id' => Module::t('meta', 'Entity ID'), 'meta_title' => Module::t('meta', 'Meta Title'), 'meta_description' => Module::t('meta', 'Meta Description'), 'meta_robots' => Module::t('meta', 'Meta Robots'), 'custom_meta' => Module::t('meta', 'Custom Meta Tags')];
 }
Exemple #6
0
 /**
  * @param FieldSetEvent $event
  */
 public function beforeFormRender($event)
 {
     $fieldSet = $event->fieldSet;
     $metaForm = Yii::$app->getView()->render('@im/seo/backend/views/meta/_form', ['form' => $fieldSet->getForm(), 'model' => $this->_model ? $this->_model : $this->getMeta()]);
     $metaTab = new Tab('meta', Module::t('meta', 'Meta information'), [new ContentBlock('metaForm', $metaForm)]);
     $fieldSet->addItem($metaTab, 'tabs');
 }
Exemple #7
0
 /**
  * @inheritdoc
  */
 public function getSocialName()
 {
     return Module::t('openGraph', 'Open Graph');
 }