本文整理汇总了PHP中AppConfig::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP AppConfig::getAll方法的具体用法?PHP AppConfig::getAll怎么用?PHP AppConfig::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppConfig
的用法示例。
在下文中一共展示了AppConfig::getAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIndex
//.........这里部分代码省略.........
}
}
if ($page->where) {
$query = $query->whereRaw($page->where);
}
if ($page->remove_dupes) {
$query = $query->groupBy('name', 'url');
}
$links = $query->where('branch', '=', $branch)->select(array('links.*'))->orderBy($order, $orderdir)->cacheTags('links')->remember(1440)->paginate($perlinkpage);
$ids = array();
foreach ($links as $link) {
$ids[] = $link->id;
}
$xda = count($ids) ? Cache::tags('links')->remember('linkData|' . implode('-', $ids), 1440, function () use($ids) {
$xdata = Data::where('table_name', '=', 'links')->join('data_types', 'data_types.id', '=', 'data.type')->whereIn('rec_id', $ids)->whereNull('data_types.deleted_at')->cacheTags('data')->remember(10080)->get();
$xdda = array();
foreach ($xdata as $xrec) {
$xdda[$xrec->rec_id][$xrec->label] = $xrec->data_body;
}
return $xdda;
}) : array();
foreach ($links as $lid => $link) {
$id = $link->id;
if (isset($xda[$id])) {
foreach ($xda[$id] as $xid => $xdt) {
$links[$lid]->{$xid} = $xdt;
}
}
}
}
$thumbs = false;
if ($page->virtual_type) {
$thumbs = Ad::where('type', '=', $page->virtual_type)->where('category', '=', $page->category)->orderBy('vorder', 'desc')->cacheTags('ads')->remember(1440)->paginate($virtualPerpage);
foreach ($thumbs as $thumb) {
Ads::track($thumb, 3, $page->id);
}
// get list of categories
$category_model = Ad::groupBy('category')->where('type', '=', $page->virtual_type)->cacheTags('ads')->remember(1440)->get(array('category'));
$categories = array();
foreach ($category_model as $category_item) {
$categories[$category_item->category] = $category_item->category;
}
// $page->dname = 'Category';
}
// benchmarking the database access
$bmEnd = microtime(true);
$page->elapsed = $bmEnd - $bmStart;
$page_vars->qstring = '';
if ($page->pass_query == 'Y') {
$qry = Input::query();
$qry['mc_rnm'] = substr(time(), 2);
if (count($qry)) {
$page_vars->qstring = '?' . http_build_query($qry);
}
}
if ($page->randomize) {
foreach (explode(',', $page->randomize) as $random_tag) {
$page_vars->{$random_tag} = mt_rand(10000, 99999);
}
}
foreach (AppConfig::getAll() as $cfi => $cfd) {
$page_vars->{$cfi} = $cfd;
}
$page_vars->nocache = NOCACHE_CODE;
if (!$page->layout) {
// if ($_SERVER['REMOTE_ADDR'] == '108.47.107.194') {
// $page->layout = 'template.layout2';
// } else {
$page->layout = 'template.layout';
// }
}
// get data on child and parent pages
$childpages = new Page();
$P = clone $childpages->getConnection()->getPaginator();
$P->setPageName('article');
$childpages->getConnection()->setPaginator($P);
$childpages = $childpages->join('article_pages', 'pages.id', '=', 'article_pages.page_id');
$childpages = $childpages->where('article_pages.parent_id', '=', $page->id);
$childpages = $childpages->whereNull('article_pages.deleted_at');
$childpages = $childpages->orderBy('pageOrder');
$childpages = $childpages->cacheTags('pages')->remember(1440);
$childpages = $childpages->paginate($perpage);
// pass ALL the data to the view
return View::make('page.page')->with('dyn_layout', $page->layout)->with('page', $page)->with('childpages', $childpages)->with('categories', $categories)->with('links', $links)->with('link_id', $link_id)->with('thumbs', $thumbs)->with('columns', $columns)->with('top_banner', empty($slug))->with('debug', $debug)->with('parse_body', Display::format($page->body, $page_vars, false, false));
} else {
if (substr($slug, -5) == '.html') {
$new_slug = substr($slug, 0, -5);
$new_page = Page::where('slug', '=', $new_slug)->cacheTags('pages')->remember(1440)->first();
if (count($new_page) > 0) {
return Redirect::to('/' . $new_slug, 301);
}
}
$missing = new Missing();
$missing->slug = $slug;
$missing->referrer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "[none]";
$missing->save();
AppLog::alert('Page Not Found', 404, json_encode(array('slug' => $slug)));
return Response::view('page.notfound', array('slug' => $slug), 404);
}
}