PHP code example of lesha724 / yii2-document-viewer

1. Go to this page and download the library: Download lesha724/yii2-document-viewer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lesha724 / yii2-document-viewer example snippets


<?= \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%'
]); 


echo \lesha724\documentviewer\ViewerJsDocumentViewer::widget([
   'url' => '/README-viewer.odt', //url на ваш документ или http://example.com/test.odt
   'width'=>'100%',
   'height'=>'100%',
]);