PHP code example of alex290 / yii2-widget-content-old

1. Go to this page and download the library: Download alex290/yii2-widget-content-old 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/ */

    

alex290 / yii2-widget-content-old example snippets

 if (!$model->isNewRecord) : 
 endif 
 if ($model->getContent() != null) : 
 foreach ($model->getContent() as $key => $widget) : 
 if ($widget->type == 1) : 
 $data = Json::decode($widget->data) 
 elseif ($widget->type == 2) : 
 $data = Json::decode($widget->data) 
 elseif ($widget->type == 3) : 
 $data = Json::decode($widget->data) 
 endif 
 endforeach 
 endif