本文整理汇总了PHP中Theme::section方法的典型用法代码示例。如果您正苦于以下问题:PHP Theme::section方法的具体用法?PHP Theme::section怎么用?PHP Theme::section使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Theme
的用法示例。
在下文中一共展示了Theme::section方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Get widgets for a base
*
* @param string $base
* @return string
*/
public function get($base)
{
if (!isset(static::$widgets[$base])) {
return false;
}
$paglets = [];
$content = '';
foreach (static::$widgets[$base] as $widget) {
$paglets[] = $widget;
if (!\Config::get('enable-bigpipe')) {
$content .= \Theme::section($widget['view'], $widget['data']);
}
}
if (\Config::get('enable-bigpipe')) {
echo "<div class='pagelets' data-id='" . $base . "' data-content='" . perfectSerialize($paglets) . "'></div>";
}
return $content;
}
示例2: render
public function render()
{
$data = ['path' => 'notification.display', 'notification' => $this->entity];
if ($this->entity->user) {
try {
$data = array_merge($data, empty($this->entity->data) ? [] : perfectUnserialize($this->entity->data));
/**
* @var $path
*/
extract($data);
/**user have seen it**/
$this->entity->markSeen();
return \Theme::section($path, $data);
} catch (\Exception $e) {
$this->entity->delete();
}
} else {
$this->entity->delete();
}
}
示例3: function
<?php
Event::listen('inline-post-text', function ($post) {
if (!empty($post->text) and !isEnglish($post->text)) {
echo Theme::section('autotranslator::link', ['post' => $post]);
}
});
示例4: app
$posts = app('App\\Repositories\\PostRepository')->lists('user-timeline');
?>
<div data-lastcheck="" data-offset="{{\Config::get('post-per-page')}}" data-type="user-timeline" id="post-list">
{{Theme::extend('timeline-post')}}
<?php
$counter = 0;
?>
@foreach($posts as $post)
@if(Cache::has('post-'.$post->id))
{{Cache::get('post-'.$post->id)}}
@else
<?php
$postContent = (string) Theme::section('post.media', ['post' => $post]);
if (Config::get('enable-query-cache', 0)) {
Cache::add('post-' . $post->id, $postContent, Config::get('post-cache-time-out', 3));
}
?>
{{$postContent}}
@endif
{{Theme::extend('timeline-post-'.$counter)}}
<?php
$counter++;
?>
@endforeach
</div>
示例5: app
*/
$mustAvoidUserRepository = app('App\\Repositories\\MustAvoidUserRepository');
$users = $mustAvoidUserRepository->get();
if (in_array(Auth::user()->id, $users)) {
Auth::logout();
Auth::logout();
if (Request::ajax()) {
return json_encode(['content' => 'login']);
} else {
return Redirect::guest('/');
}
}
});
Route::filter('maintenance', function () {
if (Config::get('maintenance-mode', 0)) {
return Theme::section('maintenance.mode');
}
});
Route::filter('admincp-auth', function () {
if (!Auth::check()) {
return Redirect::route('admincp-login');
}
if (!Auth::user()->isAdmin()) {
return Redirect::route('admincp-login');
}
//use here to update online status of this user
Auth::user()->updateOnline();
});
Route::filter('auth.basic', function () {
return Auth::basic();
});
示例6: sleep
}
\Auth::logout();
\Session::flush();
sleep(1);
\Auth::logout();
\Session::flush();
return \Redirect::to('/');
}]);
require 'routes/user.php';
require 'routes/post.php';
require 'routes/pages.php';
Route::any('load/pagelets', ['uses' => function () {
$pagelets = perfectUnserialize(\Input::get('pagelets'));
$content = "";
foreach ($pagelets as $pagelet) {
$content .= \Theme::section($pagelet['view'], $pagelet['data']);
}
echo $content;
}]);
if (!Config::get('disable-game', 0)) {
}
require 'routes/games.php';
require 'routes/message.php';
require 'routes/connection.php';
require 'routes/search.php';
require 'routes/discover.php';
require 'routes/help.php';
require 'routes/report.php';
require 'routes/additional-page.php';
require 'routes/notification.php';
require 'routes/photo.php';