PHP code example of pavlinter / yii2-dot

1. Go to this page and download the library: Download pavlinter/yii2-dot 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/ */

    

pavlinter / yii2-dot example snippets



$data = [
    [
        'name' => 'Jim',
        'age' => '35',
        'msg' => 'Pellentesque non felis ligula',
    ],
    [
        'name' => 'Robert',
        'msg' => 'Cras sagittis dapibus lacus',
    ],
    [
        'name' => 'Maikl',
        'age' => '12',
    ],
    [
        'msg' => 'Cras sagittis dapibus lacus',
    ],
];

$this->registerJs('
    var data = ' . Json::encode($data) .';
    $("#comment-box-html").tmplHtml("comment", data);
    $("#comment-box-append").tmplAppend("comment", data); //append each
    $("#comment-box-prepend").tmplPrepend("comment", data); //prepend each

');


php composer.phar