本文整理汇总了PHP中Reader::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Reader::get方法的具体用法?PHP Reader::get怎么用?PHP Reader::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reader
的用法示例。
在下文中一共展示了Reader::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Get a settings value
* @param string $path dotted string
* @return string
*/
public function get($path, $default = NULL)
{
// get the setting
$setting = $this->_reader->get($path, $default);
// replace substitutes
if (is_string($setting)) {
$setting = strtr($setting, array(':module' => $this->_module));
}
return $setting;
}
开发者ID:yubinchen18,项目名称:A-basic-website-project-for-a-company-using-the-MVC-pattern-in-Kohana-framework,代码行数:15,代码来源:Settings.php
示例2: get
/**
* Get a text value
* @param string $path dotted string
* @param array $substitutes
* @param bool $ucFirst
* @return string
*/
public function get($path, $substitutes = array(), $ucFirst = true)
{
// get the string
$string = $this->_reader->get($path, '');
// replace substitutes
if (is_string($string)) {
if (is_string($substitutes)) {
// a subs string was given. Use an alternative set of subs from the loaded text
$substitutes = $this->_substitutes($substitutes);
} else {
// use default subs as substitues, merge with given
$substitutes = array_merge($this->_substitutes, $substitutes);
}
// replace substitues
$string = strtr($string, $substitutes);
}
// Capitalize first
if ($ucFirst && is_string($string)) {
$string = ucfirst($string);
}
return $string;
}
开发者ID:yubinchen18,项目名称:A-basic-website-project-for-a-company-using-the-MVC-pattern-in-Kohana-framework,代码行数:29,代码来源:Text.php
示例3: Reader
#!/usr/bin/php -q
<?php
require_once 'common.php';
require_once 'debug.php';
require_once 'reader.php';
require_once 'cleaner.php';
require_once 'lexer.php';
require_once 'interpreter.php';
try {
//$filename = 'example.bsc';
$filename = !empty($argv[1]) ? $argv[1] : "";
$reader = new Reader($filename);
$cleaner = new Cleaner($reader->get());
$lexer = new Lexer($cleaner->get());
throw new Debug(999, "Lexer output", $lexer->get());
//$parser = new Parser($lexer->get());
} catch (Debug $d) {
die($d->getDebug());
} catch (Exception $e) {
if (VERBOSE) {
$msg = var_dump(array('file' => $e->getFile(), 'line' => $e->getLine(), 'message' => $e->getMessage(), 'trace' => $e->getTraceAsString()));
} else {
$msg = $e->getMessage();
}
die($msg . "\n");
}