page.php 1.3 KB

1234567891011121314151617181920212223242526272829
  1. <?php
  2. $this->title = $model->title_seo;
  3. Yii::$app->og->title =($model->title_seo)?$model->title_seo:$model->title;
  4. Yii::$app->og->description = ($model->description_seo && trim($model->description_seo ) <> '')?str_replace( '"', "&quot;", strip_tags($model->description_seo ) ):trim(str_replace( '"',"'",substr(strip_tags( $model->content ),0,150)))."...";
  5. Yii::$app->og->canonical = $model->getUrl(true);
  6. \Yii::$app->og->og_url = $model->getUrl(true);
  7. \Yii::$app->og->og_type = "article";
  8. \Yii::$app->og->og_title = htmlspecialchars(($model->title_seo)?strip_tags(str_replace( '"',"&quot;",$model->title_seo)):strip_tags(str_replace( '"',"&quot;",$model->title)));
  9. \Yii::$app->og->og_description = ($model->description_seo && trim($model->description_seo) <> '')?str_replace( '"',"&quot;",strip_tags($model->description_seo)):trim(str_replace( '"',"&quot;",substr(strip_tags( $model->content ),0,150)))."...";
  10. \Yii::$app->og->dtpub = date( "r", strtotime( $model->updated ) );
  11. \Yii::$app->og->og_image = "/img/amic-logo.svg";
  12. //$this->description = $model->description_seo;
  13. ?>
  14. <div class="row justify-content-md-center">
  15. <div class="col-md-10">
  16. <div id="post" class="post">
  17. <section class="text">
  18. <h1><?=$model->title?></h1>
  19. <?=$model->content?>
  20. </section>
  21. </div>
  22. </div>
  23. </div>
  24. <?