本文整理汇总了PHP中PHPRtfLite::getCharset方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPRtfLite::getCharset方法的具体用法?PHP PHPRtfLite::getCharset怎么用?PHP PHPRtfLite::getCharset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPRtfLite
的用法示例。
在下文中一共展示了PHPRtfLite::getCharset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* renders form field
*/
public function render()
{
$stream = $this->_rtf->getWriter();
$stream->write(' ');
if ($this->_font) {
$stream->write('{' . $this->_font->getContent());
}
$defaultValue = PHPRtfLite_Utf8::getUnicodeEntities($this->_defaultValue, $this->_rtf->getCharset());
$content = '{\\field' . '{\\*\\fldinst ' . $this->getType() . ' {\\*\\formfield' . $this->getRtfCode() . '}' . '}{\\fldrslt ' . $defaultValue . '}}';
$stream->write($content);
if ($this->_font) {
$stream->write($this->_font->getClosingContent() . '}');
}
$stream->write(' ');
}
示例2: render
/**
* renders footnote/endnote
*/
public function render()
{
$stream = $this->_rtf->getWriter();
$typeSetting = $this->_typeSettingType != self::TYPE_NORMAL ? '\\' . $this->_typeSettingType : '';
$stream->write('{' . $typeSetting . '\\chftn}' . '{' . $this->getTypeAsRtfCode() . '\\pard\\plain\\lin283\\fi-283 ');
if ($this->_parFormat) {
$stream->write($this->_parFormat->getContent());
}
if ($this->_font) {
$stream->write($this->_font->getContent());
}
$charset = $this->_rtf->getCharset();
$textEncoded = PHPRtfLite::quoteRtfCode($this->_text);
$stream->write('{\\up6\\chftn}' . "\r\n" . PHPRtfLite_Utf8::getUnicodeEntities($textEncoded, $charset) . '} ');
}