виджет для отображения online документов с помощью google viewer, microsoft document viewer и viewerJs
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist lesha724/yii2-document-viewer "*"
or add
"lesha724/yii2-document-viewer": "*"
to the require section of your composer.json
file.
Once the extension is installed, simply use it in your code by :
<?= \lesha724\documentviewer\GoogleDocumentViewer::widget([
'url'=>'http://example.com/test.doc',//url на ваш документ
'width'=>'100%',
'height'=>'100%',
//https://geektimes.ru/post/111647/
'embedded'=>true,
'a'=>\lesha724\documentviewer\GoogleDocumentViewer::A_BI //A_V = 'v', A_GT= 'gt', A_BI = 'bi'
]); ?>
<?= \lesha724\documentviewer\MicrosoftDocumentViewer::widget([
'url'=>'http://example.com/test.doc',//url на ваш документ
'width'=>'100%',
'height'=>'100%'
]); ?>
<?php
echo \lesha724\documentviewer\ViewerJsDocumentViewer::widget([
'url' => '/README-viewer.odt', //url на ваш документ или http://example.com/test.odt
'width'=>'100%',
'height'=>'100%',
]);?>
Comments