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

Documentation is available at TRadioButton.php

  1. <?php
  2. namespace Adianti\Widget\Form;
  3.  
  4. use Adianti\Widget\Form\AdiantiWidgetInterface;
  5. use Adianti\Widget\Form\TField;
  6.  
  7. /**
  8.  * RadioButton 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 TRadioButton extends TField implements AdiantiWidgetInterface
  18. {
  19.     private $checked;
  20.    
  21.     /**
  22.      * Class Constructor
  23.      * @param $name Name of the widget
  24.      */
  25.     public function __construct($name)
  26.     {
  27.         parent::__construct($name);
  28.         $this->id = 'tradiobutton_' mt_rand(10000000001999999999);
  29.         $this->tag->{'class''';
  30.     }
  31.     
  32.     /**
  33.      * Show the widget at the screen
  34.      */
  35.     public function show()
  36.     {
  37.         // define the tag properties
  38.         $this->tag->{'name'}  $this->name;
  39.         $this->tag->{'value'$this->value;
  40.         $this->tag->{'type'}  'radio';
  41.         
  42.         if ($this->id and empty($this->tag->{'id'}))
  43.         {
  44.             $this->tag->{'id'$this->id;
  45.         }
  46.         
  47.         // verify if the field is not editable
  48.         if (!parent::getEditable())
  49.         {
  50.             // make the widget read-only
  51.             //$this->tag-> disabled   = "1"; // the value don't post
  52.             $this->tag->{'onclick'"return false;";
  53.             $this->tag->{'style'}   'pointer-events:none';
  54.             $this->tag->{'tabindex''-1';
  55.         }
  56.         // show the tag
  57.         $this->tag->show();
  58.     }
  59. }