Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
systems:yii2:yii_2.0_third_party_components [2017/11/03 15:54]
smayr [Barcoding (yii2-barcode-generator)]
systems:yii2:yii_2.0_third_party_components [2018/02/05 14:42] (current)
smayr [PHPOffice/PhpSpreadsheet]
Line 944: Line 944:
 </code> </code>
  
-== yii2-phpexcel PhpExcel ==+== yii2-phpexcel PhpExcel (Deprecated: use PHPOffice/PhpSpreadsheet) ==
 Get documentation from:  Get documentation from: 
   * [[https://github.com/moonlandsoft/yii2-phpexcel]]   * [[https://github.com/moonlandsoft/yii2-phpexcel]]
Line 953: Line 953:
 </code> </code>
  
 +== PHPOffice/PhpSpreadsheet ==
 +Get documentation from:
 +  * [[https://github.com/PHPOffice/PhpSpreadsheet]]
 +  * [[https://phpspreadsheet.readthedocs.io/en/develop|Documentation]]
 +
 +Install the extension:
 +<code bash>
 +$ composer require phpoffice/phpspreadsheet
 +</code>
 +
 +Example:
 +<code php>
 +<?php
 +
 +require 'vendor/autoload.php';
 +
 +use PhpOffice\PhpSpreadsheet\Spreadsheet;
 +use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
 +
 +$spreadsheet = new Spreadsheet();
 +$sheet = $spreadsheet->getActiveSheet();
 +$sheet->setCellValue('A1', 'Hello World !');
 +
 +$writer = new Xlsx($spreadsheet);
 +$writer->save('hello world.xlsx');
 +</code>
 == DatePicker == == DatePicker ==
   * run in your project dir: <code>   * run in your project dir: <code>
Line 1620: Line 1646:
     'elementId' => 'showBarcode',   // div or canvas id     'elementId' => 'showBarcode',   // div or canvas id
     'value'     => '4797001018719', // value for EAN 13 be careful to set right values for each barcode type     'value'     => '4797001018719', // value for EAN 13 be careful to set right values for each barcode type
-    //'value'     => str_pad("{$model->serialnum}", 13, "0", STR_PAD_LEFT), // eg if using a model+    //'value'     => str_pad("{$model->serialnum}", 12, "0", STR_PAD_LEFT), // eg if using a model
     'type'      => 'ean13',         // supported types: ean8, ean13, upc, std25, int25, code11, code39, code93,      'type'      => 'ean13',         // supported types: ean8, ean13, upc, std25, int25, code11, code39, code93, 
                                     //                  code128, codabar, msi, datamatrix                                     //                  code128, codabar, msi, datamatrix
Line 1631: Line 1657:
   * [[http://www.yiiframework.com/extension/yii2-barcode-generator-8-types/|yii2-barcode-generator]]   * [[http://www.yiiframework.com/extension/yii2-barcode-generator-8-types/|yii2-barcode-generator]]
   * [[http://barcode-coder.com/en/barcode-online-generator-2.html|Barcode Coder Documentation]]   * [[http://barcode-coder.com/en/barcode-online-generator-2.html|Barcode Coder Documentation]]
 +
 +== Mermaid JS support ==
 +  * Download distribution package from [[https://unpkg.com/mermaid/]] (eg: ''dist'' folder in  [[https://unpkg.com/mermaid@7.1.0/dist/]])
 +  * Get documentation in [[https://mermaidjs.github.io]]
 +
 +Edit asset references in ''@app/assets/AppAsset.php'':
 +<code php>
 +<?php
 +namespace app\assets;
 +
 +use yii\web\AssetBundle;
 +
 +/**
 + * @author Qiang Xue <qiang.xue@gmail.com>
 + * @since 2.0
 + */
 +class AppAsset extends AssetBundle
 +{
 +    public $basePath = '@webroot';
 +    public $baseUrl = '@web';
 +    public $css = [
 +        'css/site.css',
 +    ];
 +    public $js = [
 +        'lib/mermaid/mermaid.min.js',  // Add support for Mermaid JS
 +    ];
 +    public $depends = [
 +        'yii\web\YiiAsset',
 +        'yii\bootstrap\BootstrapAsset',
 +    ];
 +}
 +</code>
 +
 +Add ''mermaid'' code to a view.  Eg: Flowchart sample:
 +<code php>
 +<div class='mermaid'>
 +graph TD;
 +    A-->B;
 +    A-->C;
 +    B-->D;
 +    C-->D;
 +</div>    
 +</code>
 +
 +== Yii2 Shopping Cart ==
 +  * [[https://github.com/omnilight/yii2-shopping-cart|Yii2 Shopping Cart]]
 +  * [[https://stackoverflow.com/questions/29443226/yii2-trouble-with-using-shopping-cart-extension]]