Lançado Adianti Framework 7.6!
Clique aqui para saber mais
menu

Adianti Solutions

API

Adianti, Framework, PHP, MVC, Active record, Front controller, IDE, RAD, Web, multiplataforma, geração de código, desenvolvimento rápido, relatórios, formulários, listagens, datagrids, gráficos, banco de dados, padrões de projeto, design patterns API do Adianti Framework.
API Docs
code
Selecione a classe

Source for file THBox.php

Documentation is available at THBox.php

  1. <?php
  2. namespace Adianti\Widget\Container;
  3.  
  4. use Adianti\Widget\Base\TElement;
  5.  
  6. /**
  7.  * Horizontal Box
  8.  *
  9.  * @version    7.4
  10.  * @package    widget
  11.  * @subpackage container
  12.  * @author     Pablo Dall'Oglio
  13.  * @copyright  Copyright (c) 2006 Adianti Solutions Ltd. (http://www.adianti.com.br)
  14.  * @license    http://www.adianti.com.br/framework-license
  15.  */
  16. class THBox extends TElement
  17. {
  18.     /**
  19.      * Class Constructor
  20.      */
  21.     public function __construct()
  22.     {
  23.         parent::__construct('div');
  24.     }
  25.     
  26.     /**
  27.      * Add an child element
  28.      * @param $child Any object that implements the show() method
  29.      */
  30.     public function add($child$style 'display:inline-table;')
  31.     {
  32.         $wrapper new TElement('div');
  33.         $wrapper->{'style'$style;
  34.         $wrapper->add($child);
  35.         parent::add($wrapper);
  36.         return $wrapper;
  37.     }
  38.     
  39.     /**
  40.      * Add a new row with many cells
  41.      * @param $cells Each argument is a row cell
  42.      */
  43.     public function addRowSet()
  44.     {
  45.         $args func_get_args();
  46.         if ($args)
  47.         {
  48.             foreach ($args as $arg)
  49.             {
  50.                 $this->add($arg);
  51.             }
  52.         }
  53.     }
  54.     
  55.     /**
  56.      * Static method for pack content
  57.      * @param $cells Each argument is a cell
  58.      */
  59.     public static function pack()
  60.     {
  61.         $box new self;
  62.         $args func_get_args();
  63.         if ($args)
  64.         {
  65.             foreach ($args as $arg)
  66.             {
  67.                 $box->add($arg);
  68.             }
  69.         }
  70.         return $box;
  71.     }
  72. }