Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.
   1  <?php namespace RedeyeVentures\GeoPattern\SVGElements;
   2  
   3  class Group extends Base
   4  {
   5      protected $tag = 'g';
   6      protected $items;
   7  
   8      function __construct($items=array(), $args=array())
   9      {
  10          $this->items = $items;
  11          $this->args = $args;
  12      }
  13  
  14      function addItem($item)
  15      {
  16          $this->items[] = $item;
  17          return $this;
  18      }
  19  
  20      function setArgs($args)
  21      {
  22          $this->args = $args;
  23          return $this;
  24      }
  25  
  26      function getString()
  27      {
  28          $svgString = '';
  29          $svgString .= "<{$this->tag} {$this->argsToString($this->args)}>";
  30          foreach ($this->items as $item)
  31          {
  32              $svgString .= $item;
  33          }
  34          $svgString .= "</{$this->tag}>";
  35  
  36          return $svgString;
  37      }
  38  }