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 TUniqueSearch.php

Documentation is available at TUniqueSearch.php

  1. <?php
  2. namespace Adianti\Widget\Form;
  3.  
  4. use Adianti\Widget\Form\TMultiSearch;
  5. use Adianti\Widget\Form\AdiantiWidgetInterface;
  6.  
  7. /**
  8.  * Unique Search Widget
  9.  *
  10.  * @version    7.4
  11.  * @package    widget
  12.  * @subpackage form
  13.  * @author     Pablo Dall'Oglio
  14.  * @copyright  Copyright (c) 2006 Adianti Solutions Ltd. (http://www.adianti.com.br)
  15.  * @license    http://www.adianti.com.br/framework-license
  16.  */
  17. class TUniqueSearch extends TMultiSearch implements AdiantiWidgetInterface
  18. {
  19.     protected $size;
  20.     
  21.     /**
  22.      * Class Constructor
  23.      * @param  $name Widget's name
  24.      */
  25.     public function __construct($name)
  26.     {
  27.         // executes the parent class constructor
  28.         parent::__construct($name);
  29.         parent::setMaxSize(1);
  30.         parent::setDefaultOption(TRUE);
  31.         parent::disableMultiple();
  32.         
  33.         $this->tag->{'widget''tuniquesearch';
  34.     }
  35.     
  36.     /**
  37.      * Set value
  38.      */
  39.     public function setValue($value)
  40.     {
  41.         $this->value $value// avoid use parent::setValue() because compat mode
  42.     }
  43.     
  44.     /**
  45.      * Return the post data
  46.      */
  47.     public function getPostData()
  48.     {
  49.         if (isset($_POST[$this->name]))
  50.         {
  51.             $val $_POST[$this->name];
  52.             return $val;
  53.         }
  54.         else
  55.         {
  56.             return '';
  57.         }
  58.     }
  59.     
  60.     /**
  61.      * Returns the size
  62.      */
  63.     public function getSize()
  64.     {
  65.         return $this->size;
  66.     }
  67.     
  68.     /**
  69.      * Show the component
  70.      */
  71.     public function show()
  72.     {
  73.         $this->tag->{'name'}  $this->name// tag name
  74.         parent::show();
  75.     }
  76. }