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


PHP PO::prepend_each_line方法代码示例

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


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

示例1: PO

 function test_prepend_each_line()
 {
     $po = new PO();
     $this->assertEquals('baba_', $po->prepend_each_line('', 'baba_'));
     $this->assertEquals('baba_dyado', $po->prepend_each_line('dyado', 'baba_'));
     $this->assertEquals("# baba\n# dyado\n# \n", $po->prepend_each_line("baba\ndyado\n\n", '# '));
 }
开发者ID:boonebgorges,项目名称:develop.wordpress,代码行数:7,代码来源:po.php

示例2: export_headers

 /**
  * Exports headers to a PO entry
  *
  * @return string msgid/msgstr PO entry for this PO file headers, doesn't
  *                contain newline at the end
  */
 public function export_headers()
 {
     $header_string = '';
     foreach ($this->headers as $header => $value) {
         $header_string .= "{$header}: {$value}\n";
     }
     $poified = PO::poify($header_string);
     if ($this->comments_before_headers) {
         $before_headers = PO::prepend_each_line(rtrim($this->comments_before_headers) . "\n", '# ');
     } else {
         $before_headers = '';
     }
     return rtrim("{$before_headers}msgid \"\"\nmsgstr {$poified}");
 }
开发者ID:bohwaz,项目名称:featherbb,代码行数:20,代码来源:PO.php

示例3: comment_block

 /**
  * Prepare a text as a comment -- wraps the lines and prepends #
  * and a special character to each line
  *
  * @access private
  * @param string $text the comment text
  * @param string $char character to denote a special PO comment,
  * 	like :, default is a space
  */
 function comment_block($text, $char = ' ')
 {
     $text = wordwrap($text, PO_MAX_LINE_LEN - 3);
     return PO::prepend_each_line($text, "#{$char} ");
 }
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:14,代码来源:po.php

示例4: test_prepend_each_line

	function test_prepend_each_line() {
		$this->assertEquals('baba_', @PO::prepend_each_line('', 'baba_'));
		$this->assertEquals('baba_dyado', @PO::prepend_each_line('dyado', 'baba_'));
		$this->assertEquals("# baba\n# dyado\n# \n", @PO::prepend_each_line("baba\ndyado\n\n", '# '));
	}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:5,代码来源:po.php


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