예제 #1
0
 public function testDownload()
 {
     $link = new Link('/file.png');
     $link->setDownload();
     $this->assertEquals('<a href="/file.png" download></a>', $link->asHtml());
     $link->setDownload('file');
     $this->assertEquals('<a href="/file.png" download="file"></a>', $link->asHtml());
 }
예제 #2
0
파일: PageletLink.php 프로젝트: fortifi/ui
 public function __construct($uri, $content = null, $selector = '#pagelet-data')
 {
     parent::__construct($uri, $content);
     $this->_tag = 'a';
     $this->setAttribute('data-uri', $uri);
     if (!Strings::containsAny($selector, ['#', '.', ' '])) {
         $selector = '#' . $selector;
     }
     $this->setAttribute('data-target', $selector);
 }