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

Documentation is available at THyperLink.php

  1. <?php
  2. namespace Adianti\Widget\Util;
  3.  
  4. use Adianti\Widget\Base\TElement;
  5.  
  6. /**
  7.  * File Link
  8.  *
  9.  * @version    7.4
  10.  * @package    widget
  11.  * @subpackage util
  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 THyperLink extends TTextDisplay
  17. {
  18.     /**
  19.      * Class Constructor
  20.      * @param  $value    text content
  21.      * @param  $location link location
  22.      * @param  $color    text color
  23.      * @param  $size     text size
  24.      * @param  $decoration text decorations (b=bold, i=italic, u=underline)
  25.      */
  26.     public function __construct($value$location$color null$size null$decoration null$icon null)
  27.     {
  28.         if ($icon)
  29.         {
  30.             $value new TImage($icon$value;
  31.         }
  32.         
  33.         parent::__construct($value$color$size$decoration);
  34.         parent::setName('a');
  35.         
  36.         if (file_exists($value))
  37.         {
  38.             $this->{'href''download.php?file='.$location;
  39.         }
  40.         else
  41.         {
  42.             $this->{'href'$location;
  43.         }
  44.         
  45.         $this->{'target''newwindow';
  46.     }
  47. }