Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

TableCell.php

Zuletzt modifiziert: 09.10.2024, 12:56 - Dateigröße: 1.58 KiB


 01  <?php
 02   
 03  /*
 04   * This file is part of the Symfony package.
 05   *
 06   * (c) Fabien Potencier <fabien@symfony.com>
 07   *
 08   * For the full copyright and license information, please view the LICENSE
 09   * file that was distributed with this source code.
 10   */
 11   
 12  namespace Symfony\Component\Console\Helper;
 13   
 14  use Symfony\Component\Console\Exception\InvalidArgumentException;
 15   
 16  /**
 17   * @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
 18   */
 19  class TableCell
 20  {
 21      /**
 22       * @var string
 23       */
 24      private $value;
 25   
 26      /**
 27       * @var array
 28       */
 29      private $options = array(
 30          'rowspan' => 1,
 31          'colspan' => 1,
 32      );
 33   
 34      /**
 35       * @param string $value
 36       * @param array  $options
 37       */
 38      public function __construct($value = '', array $options = array())
 39      {
 40          $this->value = $value;
 41   
 42          // check option names
 43          if ($diff = array_diff(array_keys($options), array_keys($this->options))) {
 44              throw new InvalidArgumentException(sprintf('The TableCell does not support the following options: \'%s\'.', implode('\', \'', $diff)));
 45          }
 46   
 47          $this->options = array_merge($this->options, $options);
 48      }
 49   
 50      /**
 51       * Returns the cell value.
 52       *
 53       * @return string
 54       */
 55      public function __toString()
 56      {
 57          return $this->value;
 58      }
 59   
 60      /**
 61       * Gets number of colspan.
 62       *
 63       * @return int
 64       */
 65      public function getColspan()
 66      {
 67          return (int) $this->options['colspan'];
 68      }
 69   
 70      /**
 71       * Gets number of rowspan.
 72       *
 73       * @return int
 74       */
 75      public function getRowspan()
 76      {
 77          return (int) $this->options['rowspan'];
 78      }
 79  }
 80