本文整理汇总了PHP中Load::dependence方法的典型用法代码示例。如果您正苦于以下问题:PHP Load::dependence方法的具体用法?PHP Load::dependence怎么用?PHP Load::dependence使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Load
的用法示例。
在下文中一共展示了Load::dependence方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: translate
function translate($lang = 'ru')
{
$config = App;
$content = ob_get_contents();
ob_end_clean();
if (self::$active) {
self::$locale = self::getAppLocale($lang);
preg_match_all(LOCALE_TEMPLATE, $content, $mathes);
if (sizeof($mathes[1]) > 0) {
foreach ($mathes[1] as $word) {
if (array_key_exists($word, self::$locale)) {
$content = str_replace(sprintf(LOCALE_TEMPLATE_CHANGE, $word), self::$locale[$word], $content);
}
}
}
}
if (($selector = Request::post('html_element')) || ($selector = Request::get('html_element'))) {
Load::dependence('simple_html_dom');
$html = str_get_html($content);
$elements = $html->find($selector);
if (sizeof($elements) > 0) {
echo $elements[0]->innertext;
} else {
echo $content;
}
} else {
echo $content;
}
}
示例2: sessionSet
static function sessionSet()
{
Load::dependence('nodatabase');
$nodatabase = Load::$dependences['nodatabase'];
$nodatabase->create('sessions');
self::$session_id = md5(self::ip());
self::createSession();
}
示例3: run
public static function run($event, $data = array(), $iso = 'ru')
{
$eventList = self::getEventList();
if (!$eventList[$event]) {
return false;
}
$model = connectionNotificationModel::create();
$notification = $model->getEvent($event);
Load::dependence('smarty');
$smarty = Load::$dependences['smarty'];
foreach ($data as $key => $value) {
$smarty->assign($key, $value);
}
foreach ($notification as $item) {
$to = $smarty->fetch('string:' . $item['to']);
$title = $smarty->fetch('string:' . $item[$iso]['title']);
$content = $smarty->fetch('string:' . $item[$iso]['content']);
$headers = "Content-type: text/html; charset=utf-8 \r\n";
$headers .= "From: " . Settings::getValue('admin_email_name', 'connection') . " <" . Settings::getValue('admin_email', 'connection') . ">\r\n";
mail($to, $title, $content, $headers);
}
}
示例4: __get
function __get($name)
{
return Load::dependence($name);
}
示例5: loadDependences
static function loadDependences($app_dir)
{
$file = String::glue($app_dir, DS, APP_CONFIG_DIR, DS, 'dependence.php');
if (File::exist($file)) {
$array = (include $file);
foreach ($array as $value) {
Load::dependence($value);
}
}
}
示例6: getView
public function getView()
{
Load::dependence('smarty');
return Load::dependence('smarty');
}