當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Smarty::_MBSTRING方法代碼示例

本文整理匯總了PHP中Smarty::_MBSTRING方法的典型用法代碼示例。如果您正苦於以下問題:PHP Smarty::_MBSTRING方法的具體用法?PHP Smarty::_MBSTRING怎麽用?PHP Smarty::_MBSTRING使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Smarty的用法示例。


在下文中一共展示了Smarty::_MBSTRING方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testDefaultWithoutMbstring

 public function testDefaultWithoutMbstring()
 {
     Smarty::$_MBSTRING = false;
     $tpl = $this->smarty->createTemplate('eval:{"Infertility unlikely to\\nbe passed on, experts say."|regex_replace:"/[\\r\\t\\n]/":" "}');
     $this->assertEquals("Infertility unlikely to be passed on, experts say.", $this->smarty->fetch($tpl));
     Smarty::$_MBSTRING = true;
 }
開發者ID:jjs180,項目名稱:dance-america,代碼行數:7,代碼來源:PluginModifierRegexReplaceTests.php

示例2: testUmlautsWithoutMbstring

 public function testUmlautsWithoutMbstring()
 {
     Smarty::$_MBSTRING = false;
     $result = "two convicts eväde nööse, jury hung.";
     $tpl = $this->smarty->createTemplate('eval:{"Two Convicts Eväde NöÖse, Jury Hung."|lower}');
     $this->assertNotEquals($result, $this->smarty->fetch($tpl));
     Smarty::$_MBSTRING = true;
 }
開發者ID:jjs180,項目名稱:dance-america,代碼行數:8,代碼來源:PluginModifierLowerTests.php

示例3: testUmlautsWithoutMbstring

 public function testUmlautsWithoutMbstring()
 {
     Smarty::$_MBSTRING = false;
     $result = "IF STRIKE ISN'T SÄTTLED ÜQUICKLY IT MAY LAST A WHILE.";
     $tpl = $this->smarty->createTemplate('eval:{"If Strike isn\'t Sättled ÜQuickly it may Last a While."|upper}');
     $this->assertNotEquals($result, $this->smarty->fetch($tpl));
     Smarty::$_MBSTRING = true;
 }
開發者ID:jjs180,項目名稱:dance-america,代碼行數:8,代碼來源:PluginModifierUpperTests.php

示例4: testUmlautsSpacesWithoutMbstring

 public function testUmlautsSpacesWithoutMbstring()
 {
     Smarty::$_MBSTRING = false;
     $result = "33";
     $tpl = $this->smarty->createTemplate('eval:{"Cold Wäve Linked tö Temperatures."|count_characters:true}');
     $this->assertNotEquals($result, $this->smarty->fetch($tpl));
     Smarty::$_MBSTRING = true;
 }
開發者ID:jjs180,項目名稱:dance-america,代碼行數:8,代碼來源:PluginModifierCountCharactersTests.php

示例5: testHtmlallWithoutMbstring

 public function testHtmlallWithoutMbstring()
 {
     Smarty::$_MBSTRING = false;
     $encoded = "aäЗдра><&ääвсствуйте";
     $result = "aテ、ミ厘エム�ミー><&amp;テ、テ、ミイム?ム?ムひイムσケムひオ";
     $tpl = $this->smarty->createTemplate('eval:{"' . $encoded . '"|unescape:"htmlall"}');
     $this->assertEquals($result, $this->smarty->fetch($tpl));
     Smarty::$_MBSTRING = true;
 }
開發者ID:manishbathla,項目名稱:smarty-php,代碼行數:9,代碼來源:PluginModifierUnescapeTests.php

示例6: testToUtf32leWithoutMbstring

 public function testToUtf32leWithoutMbstring()
 {
     Smarty::$_MBSTRING = false;
     $encoded = "hällö wörld 8";
     $result = mb_convert_encoding($encoded, "UTF-32LE", "UTF-8");
     $tpl = $this->smarty->createTemplate('eval:{"' . $encoded . '"|to_charset:"UTF-32LE"}');
     $this->assertEquals($encoded, $tpl->fetch());
     Smarty::$_MBSTRING = true;
 }
開發者ID:mrsank,項目名稱:work_sample,代碼行數:9,代碼來源:PluginModifierCharsetTests.php

示例7: testDefaultWithoutMbstring

 public function testDefaultWithoutMbstring()
 {
     Smarty::$_MBSTRING = false;
     $tpl = $this->smarty->createTemplate('eval:{"hello world."|count_sentences}');
     $this->assertEquals("1", $this->smarty->fetch($tpl));
     $tpl = $this->smarty->createTemplate('eval:{"hello world. I\'m another? Sentence!"|count_sentences}');
     $this->assertEquals("3", $this->smarty->fetch($tpl));
     $tpl = $this->smarty->createTemplate('eval:{"hello world.wrong"|count_sentences}');
     $this->assertEquals("0", $this->smarty->fetch($tpl));
     Smarty::$_MBSTRING = true;
 }
開發者ID:jjs180,項目名稱:dance-america,代碼行數:11,代碼來源:PluginModifierCountSentencesTests.php

示例8: testNonstdWithoutMbstring

 public function testNonstdWithoutMbstring()
 {
     Smarty::$_MBSTRING = false;
     $tpl = $this->smarty->createTemplate('eval:{"' . utf8_decode('sma\'rty@»example«.com') . '"|escape:"nonstd"}');
     $this->assertEquals("sma'rty@&#187;example&#171;.com", $this->smarty->fetch($tpl));
     Smarty::$_MBSTRING = true;
 }
開發者ID:jjs180,項目名稱:dance-america,代碼行數:7,代碼來源:PluginModifierEscapeTests.php

示例9: testUmlautsWithoutMbstring

 public function testUmlautsWithoutMbstring()
 {
     Smarty::$_MBSTRING = false;
     $result = '<a href="mailto:me+smtpext@example.com?cc=you@example.com,they@example.com&subject=h%C3%A4llo%20w%C3%B6rld" >me+smtpext@example.com</a>';
     $tpl = $this->smarty->createTemplate('eval:{mailto address="me+smtpext@example.com" cc="you@example.com,they@example.com" subject="hällo wörld"}');
     $this->assertEquals($result, $this->smarty->fetch($tpl));
     Smarty::$_MBSTRING = true;
 }
開發者ID:mrsank,項目名稱:work_sample,代碼行數:8,代碼來源:PluginFunctionMailtoTests.php

示例10: testLinebreaks2WithoutMbstring

 public function testLinebreaks2WithoutMbstring()
 {
     Smarty::$_MBSTRING = false;
     $tpl = $this->smarty->createTemplate('eval:{"Blind woman
         gets 
         new kidney from dad she hasn\'t seen in years."|wordwrap:30}');
     $this->assertEquals("Blind woman\n            gets \n            new kidney from\ndad she hasn't seen in years.", $this->smarty->fetch($tpl));
     Smarty::$_MBSTRING = true;
 }
開發者ID:jjs180,項目名稱:dance-america,代碼行數:9,代碼來源:PluginModifierWordwrapTests.php

示例11: testQuotesBeginningWithoutMbstring

 public function testQuotesBeginningWithoutMbstring()
 {
     Smarty::$_MBSTRING = false;
     $tpl = $this->smarty->createTemplate('eval:{"\\"delayed. umlauts\\" foo."|capitalize}');
     $this->assertEquals("\"Delayed. Umlauts\" Foo.", $this->smarty->fetch($tpl));
     $tpl = $this->smarty->createTemplate('eval:{"\'delayed. umlauts\' foo."|capitalize}');
     $this->assertEquals("'Delayed. Umlauts' Foo.", $this->smarty->fetch($tpl));
     Smarty::$_MBSTRING = true;
 }
開發者ID:mrsank,項目名稱:work_sample,代碼行數:9,代碼來源:PluginModifierCapitalizeTests.php

示例12: testMiddleWithoutMbstring

 public function testMiddleWithoutMbstring()
 {
     Smarty::$_MBSTRING = false;
     $result = 'Two Sisters Re..ckout Counter.';
     $tpl = $this->smarty->createTemplate('eval:{"Two Sisters Reunite after Eighteen Years at Checkout Counter."|truncate:30:"..":true:true}');
     $this->assertEquals($result, $this->smarty->fetch($tpl));
     Smarty::$_MBSTRING = true;
 }
開發者ID:jjs180,項目名稱:dance-america,代碼行數:8,代碼來源:PluginModifierTruncateTests.php

示例13: testStyleEmailWithoutMbstring

 public function testStyleEmailWithoutMbstring()
 {
     Smarty::$_MBSTRING = false;
     $result = "\n\nThis is foo. This is foo. This is foo. This is foo. This is foo. This is\nfoo.\n\nThis is bar.\n\nbar foo bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo\nbar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo\nfoo.\n\n";
     $tpl = $this->smarty->createTemplate('eval:{textformat style="email"}' . $this->string . '{/textformat}');
     $this->assertEquals($result, $this->smarty->fetch($tpl));
     Smarty::$_MBSTRING = true;
 }
開發者ID:mrsank,項目名稱:work_sample,代碼行數:8,代碼來源:PluginBlockTextformatTests.php


注:本文中的Smarty::_MBSTRING方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。