Advertisement
TheFan1968

FusionCharts: ViewClass for ZendFramework 3 and Fusion

Jan 18th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.13 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Kvberlin\FusionCharts;
  4.  
  5. use Kvberlin\FusionCharts\Charts\Chart;
  6. use Zend\Debug\Debug;
  7. use Zend\View\Model\ViewModel;
  8.  
  9.  
  10. /**
  11.   * ZendFramework3 FusionView
  12.  * Autor: Peter Wendel (ITA),- 897
  13.  * Datum: 07.12.2017
  14.  *
  15.  * Kurzbeschreibung:
  16.  * View zur Anzeige eines Charts
  17.  *
  18.  * @license   http://framework.zend.com/license/new-bsd New BSD License
  19.  * Created by PhpStorm.
  20.  */
  21. class FusionView extends ViewModel
  22. {
  23.     /**
  24.      * @var Chart
  25.      */
  26.     private $chart;
  27.  
  28.     public function __construct(string $chartType,array $data)
  29.     {
  30.         parent::__construct();
  31.         $this->chart = new Chart($chartType,$data);
  32.         $this->setTemplate('/fusion/chartview');
  33.         $this->setVariable('chart',$this->chart);
  34.         $this->setFooter(true);
  35.     }
  36.  
  37.     public function getChart(){
  38.         return $this->chart;
  39.     }
  40.  
  41.     public function setParams(array $params){
  42.         $this->setVariable('params', $params);
  43.     }
  44.  
  45.     public function setFooter(bool $footer,string $footer_content='default'){
  46.         $this->setVariables(['footer' => $footer, 'footer_content' => $footer_content]);
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement