本文整理汇总了PHP中GeSHi::set_numbers_highlighting方法的典型用法代码示例。如果您正苦于以下问题:PHP GeSHi::set_numbers_highlighting方法的具体用法?PHP GeSHi::set_numbers_highlighting怎么用?PHP GeSHi::set_numbers_highlighting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeSHi
的用法示例。
在下文中一共展示了GeSHi::set_numbers_highlighting方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
function load()
{
if ($this->exists() == true) {
$this->import();
$this->lng = $this->data['language'];
$this->source = $this->data['source'];
} else {
if (!class_exists('GeSHi')) {
include_once 'classes/class.geshi.php';
}
global $lang;
$language = $this->hasLanguage() ? $this->lng : 'text';
$geshi = new GeSHi($this->source, $language, 'classes/geshi');
$geshi->set_encoding($lang->charset());
$geshi->enable_classes(false);
$geshi->set_header_type(GESHI_HEADER_DIV);
$geshi->enable_keyword_links(true);
$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 5);
if (!$this->hasLanguage()) {
$geshi->enable_highlighting(false);
$geshi->set_numbers_highlighting(false);
$geshi->set_brackets_highlighting(false);
$language = '';
} else {
$language = $geshi->get_language_name();
}
$this->data = array('language' => $language, 'parsed' => $geshi->parse_code(), 'source' => $this->source);
$this->export();
}
}
示例2: fread
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
$fileName = $fileURL;
if(ereg("[^/]+\.java", $fileURL, $matches)){
$fileName = $matches[0];
}
include_once 'geshi/geshi.php';
$geshi = new GeSHi($contents, 'java');
$geshi->set_header_type(GESHI_HEADER_PRE);
$geshi->set_numbers_highlighting(false);
$geshi->set_overall_style('color: rgb(0,0,0); border: 1px solid #d0d0d0; background-color: #f0f0f0;', true);
// Note the use of set_code_style to revert colours...
$geshi->set_line_style('font: normal normal 95% \'Courier New\', Courier, monospace; color: black;', 'font-weight: bold; color: blue;', true);
//for methods
$geshi->set_methods_style(1, "color: black;", false);
//for multi-line comments /**/
$geshi->set_comments_style('MULTI','color: rgb(63,127,95); font-style: code;', false);
//for 'import' keyword
// $geshi->set_comments_style(2,'color: rgb(127,0,85); font-weight: bold;', false);
//for string constants
$geshi->set_strings_style('color: rgb(42,0,255);', true);