Beispiel #1
0
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use common\models\fund;
/* @var $this yii\web\View */
/* @var $model common\models\base\fund\Thirdproduct */
$web = \App::getAlias('@web') . '/upload/' . $model->contract;
$webs = \App::getAlias('@web') . '/upload/' . $model->intentcontract;
$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => "第三方债权", 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="thirdproduct-view">


    <p><a href="<?php 
echo $web;
?>
" target="_blank">合同查看</a></p>
    <p><a href="<?php 
echo $webs;
?>
" target="_blank">意向合同查看</a></p>
    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'title', 'intro', 'source', 'creditor', 'realname', 'remarks', 'amount', 'start_at', 'end_at', 'rate', 'create_at', 'update_at', ['attribute' => 'status', 'value' => $model->statusLabel], 'reject'], 'template' => '<tr><th>{label}</th><td>{value}</td></tr>']);
?>

</div>
 /**
  * Get a file extension type based on the file MIME info.
  *
  *
  * @param string $file The file.
  *
  * @return null|string The extension.
  */
 public function getMimeTypeByExtension($path)
 {
     if (!$this->mimeCache) {
         $this->mimeCache = (require \App::getAlias('disco.mime'));
     }
     //if
     if (isset($this->mimeCache[$this->getExtension($path)])) {
         return $this->mimeCache[$this->getExtension($path)];
     }
     //if
     return null;
 }