当前位置: 首页>>代码示例>>PHP>>正文


PHP Text类代码示例

本文整理汇总了PHP中Text的典型用法代码示例。如果您正苦于以下问题:PHP Text类的具体用法?PHP Text怎么用?PHP Text使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Text类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testCanPassCustomTable

 public function testCanPassCustomTable()
 {
     $table = new Table();
     $table['%'] = '001100110011';
     $text = new Text($table);
     $this->assertSame('AVSLAG -30%', $text->fromMorse($text->toMorse('Avslag -30%')));
 }
开发者ID:rexxars,项目名称:morse,代码行数:7,代码来源:TextTest.php

示例2: show

 /**
  * Standard-Angezeige.
  *
  * ist ein Content definiert, wird dieser ebenfalls mit angegeben.   
  */
 function show()
 {
     echo "<a name='" . $this->NAME . "' ";
     if ($this->XPOS > 0 && $this->YPOS > 0) {
         echo " style=\"  position:absolute; top:" . $this->YPOS . "px; left:" . $this->XPOS . "px; \" ";
     }
     if ($this->XPOS < 0 && $this->YPOS > 0) {
         echo " style=\"  position:absolute; top:" . $this->YPOS . "px; right:" . $this->XPOS * -1 . "px; \" ";
     }
     if ($this->XPOS < 0 && $this->YPOS < 0) {
         echo " style=\"  position:absolute; bottom:" . $this->YPOS * -1 . "px; right:" . $this->XPOS * -1 . "px; \" ";
     }
     if ($this->XPOS > 0 && $this->YPOS < 0) {
         echo " style=\"  position:absolute; bottom:" . $this->YPOS * -1 . "px; left:" . $this->XPOS . "px; \" ";
     }
     echo $this->getToolTipTag() . ">";
     if (get_class($this->TEXT) && method_exists($this->TEXT, "show")) {
         $this->TEXT->show();
     } else {
         $t = new Text($this->TEXT);
         $t->setFilter(false);
         $t->show();
     }
     echo "</a>";
 }
开发者ID:CyborgOne,项目名称:cybihomecontrol_ui,代码行数:30,代码来源:Achor.php

示例3: FeedItems

	function FeedItems() {
		$output = new DataObjectSet();
		
		include_once(Director::getAbsFile(SAPPHIRE_DIR . '/thirdparty/simplepie/SimplePie.php'));
		
		$t1 = microtime(true);
		$this->feed = new SimplePie($this->AbsoluteRssUrl, TEMP_FOLDER);
		$this->feed->init();
		if($items = $this->feed->get_items(0, $this->NumberToShow)) {
			foreach($items as $item) {
				
				// Cast the Date
				$date = new Date('Date');
				$date->setValue($item->get_date());

				// Cast the Title
				$title = new Text('Title');
				$title->setValue($item->get_title());

				$output->push(new ArrayData(array(
					'Title' => $title,
					'Date' => $date,
					'Link' => $item->get_link()
				)));
			}
			return $output;
		}
	}
开发者ID:neopba,项目名称:silverstripe-book,代码行数:28,代码来源:RSSWidget.php

示例4: testGetNextEol

 public function testGetNextEol()
 {
     $text = new Text("\n");
     $this->assertEquals(0, $text->getNextEol());
     $text = new Text("roman");
     $this->assertEquals(4, $text->getNextEol());
 }
开发者ID:romanpitak,项目名称:Nginx-Config-Processor,代码行数:7,代码来源:TextTest.php

示例5: testCompile

 public function testCompile()
 {
     $field = new Text("test", "Test");
     $expected = "Test";
     $value = $field->compile();
     $this->assertEquals($expected, $value);
 }
开发者ID:jenwachter,项目名称:html-form,代码行数:7,代码来源:TextTest.php

示例6: getComponent

 public function getComponent($value, $cellFont, $row, $column)
 {
     $text = new Text();
     $text->setFont($cellFont);
     $text->value = $value;
     return $text;
 }
开发者ID:sigmadesarrollo,项目名称:logisoft,代码行数:7,代码来源:BaseCellRenderer.php

示例7: RSSItems

 /**
  * Gets a list of all the items in the RSS feed given a user-provided URL, limit, and date format
  *
  * @return ArrayList
  */
 public function RSSItems()
 {
     if (!$this->FeedURL) {
         return false;
     }
     $doc = new DOMDocument();
     @$doc->load($this->FeedURL);
     $items = $doc->getElementsByTagName('item');
     $feeds = array();
     foreach ($items as $node) {
         $itemRSS = array('title' => $node->getElementsByTagName('title')->item(0)->nodeValue, 'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue, 'link' => $node->getElementsByTagName('link')->item(0)->nodeValue, 'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue);
         $feeds[] = $itemRSS;
     }
     $output = ArrayList::create(array());
     $count = 0;
     foreach ($feeds as $item) {
         if ($count >= $this->Count) {
             break;
         }
         // Cast the Date
         $date = new Date('Date');
         $date->setValue($item['date']);
         // Cast the Title
         $title = new Text('Title');
         $title->setValue($item['title']);
         $output->push(new ArrayData(array('Title' => $title, 'Date' => $date->Format($this->DateFormat), 'Link' => $item['link'])));
         $count++;
     }
     return $output;
 }
开发者ID:helpfulrobot,项目名称:unclecheese-dashboard,代码行数:35,代码来源:DashboardRSSFeedPanel.php

示例8: testPlacementAppend

 public function testPlacementAppend()
 {
     $decorator = new Text('foo');
     $decorator->setOption('placement', 'append');
     $expected = 'barfoo';
     $actual = $decorator->render('bar');
     $this->assertSame($expected, $actual);
 }
开发者ID:urbanetter,项目名称:muentschi,代码行数:8,代码来源:TextTest.php

示例9: init

 public static function init($name, $value, $attrs = null)
 {
     $t = new Text($name, $value);
     if ($attrs) {
         $t->add_attrs($attrs);
     }
     return $t;
 }
开发者ID:DaniloEpic,项目名称:slast,代码行数:8,代码来源:Formulario.php

示例10: testLimitWordCountXML

 /**
  * Test {@link Text->LimitWordCountXML()}
  */
 function testLimitWordCountXML()
 {
     $cases = array('<p>Stuff & stuff</p>' => 'Stuff &amp;...', "Stuff\nBlah Blah Blah" => "Stuff<br />Blah Blah...", "Stuff<Blah Blah" => "Stuff&lt;Blah Blah", "Stuff>Blah Blah" => "Stuff&gt;Blah Blah");
     foreach ($cases as $originalValue => $expectedValue) {
         $textObj = new Text('Test');
         $textObj->setValue($originalValue);
         $this->assertEquals($expectedValue, $textObj->LimitWordCountXML(3));
     }
 }
开发者ID:racontemoi,项目名称:shibuichi,代码行数:12,代码来源:TextTest.php

示例11: testStrikeThrough

 public function testStrikeThrough()
 {
     // Arrange
     $text = new Text('Some italic text.', Text::STRIKETHROUGH);
     // Act
     $content = $text->toMarkDown();
     // Assert
     $this->assertSame('--Some italic text.-- ', $content);
 }
开发者ID:pachico,项目名称:markdownwriter,代码行数:9,代码来源:TextTest.php

示例12: fromString

 public static function fromString(Text $configString)
 {
     $text = '';
     while (false === $configString->eof() && false === $configString->eol()) {
         $text .= $configString->getChar();
         $configString->inc();
     }
     return new Comment(ltrim($text, "# "));
 }
开发者ID:romanpitak,项目名称:Nginx-Config-Processor,代码行数:9,代码来源:Comment.php

示例13: writeText

 protected function writeText(Text $textChild, $level)
 {
     $newLine = $this->_pretty ? $this->_newLine : '';
     $indent = $this->_pretty ? str_repeat($this->_tabString, $level) : '';
     $text = $textChild->getText();
     //TODO: Need some kind of mb_wordwrap here, maybe:
     //http://stackoverflow.com/questions/3825226/multi-byte-safe-wordwrap-function-for-utf-8?
     return $this->_pretty && mb_strlen($text, 'utf-8') > $this->_textWrap ? $indent . wordwrap(str_replace("\n", '', $text), $this->_textWrap, "{$newLine}{$indent}") : $text;
 }
开发者ID:talesoft,项目名称:tale-framework,代码行数:9,代码来源:Writer.php

示例14: testLimitSentences

 /**
  * Test {@link Text->LimitSentences()}
  */
 public function testLimitSentences()
 {
     $cases = array('' => '', 'First sentence.' => 'First sentence.', 'First sentence. Second sentence' => 'First sentence. Second sentence.', '<p>First sentence.</p>' => 'First sentence.', '<p>First sentence. Second sentence. Third sentence</p>' => 'First sentence. Second sentence.', '<p>First sentence. <em>Second sentence</em>. Third sentence</p>' => 'First sentence. Second sentence.', '<p>First sentence. <em class="dummyClass">Second sentence</em>. Third sentence</p>' => 'First sentence. Second sentence.');
     foreach ($cases as $originalValue => $expectedValue) {
         $textObj = new Text('Test');
         $textObj->setValue($originalValue);
         $this->assertEquals($expectedValue, $textObj->LimitSentences(2));
     }
 }
开发者ID:normann,项目名称:sapphire,代码行数:12,代码来源:TextTest.php

示例15: showDescription

 function showDescription()
 {
     $spc = new Spacer();
     $spc->show();
     $td = new Text("Beschreibung:", 2, true);
     $td->show();
     $d = new Text($this->getDescription());
     $d->show();
 }
开发者ID:CyborgOne,项目名称:cybihomecontrol_ui,代码行数:9,代码来源:LogFile.php


注:本文中的Text类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。