本文整理汇总了PHP中Block::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Block::all方法的具体用法?PHP Block::all怎么用?PHP Block::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Block
的用法示例。
在下文中一共展示了Block::all方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIndex
public function getIndex()
{
$title = "Блоки";
$desc = "обзор и управление Блоками";
$blocks = \Block::all();
return view('blocks::list')->withTitle($title)->withDesc($desc)->withBlocks($blocks);
}
示例2: boot
/**
* Boot the service provider.
* @return void
*/
public function boot()
{
$this->loadViewsFrom(__DIR__ . '/../resources/views', 'blocks');
$this->loadViewsFrom(blocks_path(), 'block');
$this->mergeConfigFrom(realpath(__DIR__ . '/../config/config.php'), 'module');
$this->publishes([__DIR__ . '/../public' => public_path('code_mirror')], 'public');
pusher('sidebar', 'blocks::sidebar', [], 2);
pusher('widgets', 'blocks::block_widget', ['blocks' => \Block::all()]);
require __DIR__ . '/routes.php';
require __DIR__ . '/blade.php';
}
示例3: function
$totalRewarded = $user->userMoney->ammount_won;
$totalWithdrawn = $user->userMoney->ammount_withdrawn;
$userMoneyAvailable = $totalAdded + $totalRewarded - ($totalInvested + $totalWithdrawn);
$view->with('moneyAvailable', $userMoneyAvailable);
});
View::creator('includes.backend.cycles', function ($view) {
$uid = Auth::user()->id;
$lastInvest = Transaction::where('user_id', '=', $uid)->where('transaction_direction', '=', 'invested')->orderBy('id', 'DESC')->first();
$amount = 0;
if ($lastInvest) {
$amount = $lastInvest->ammount;
}
$view->with('lastInvestedAmmount', $amount);
});
View::creator('homepage', function ($view) {
$blocks = Block::all();
// TODO: Improve this part. Add validation.
foreach ($blocks as $block) {
$block->content = json_decode($block->content);
}
$view->with('blocks', $blocks);
});
App::missing(function ($exception) {
return Response::view('errors/404', array(), 404);
});
Route::get('rules', function () {
return View::make('rules');
});
Route::get('news', function () {
return View::make('news');
});
示例4: showBlocks
public function showBlocks()
{
$blocks = Block::all();
return View::make('backend.admin.config.blockslist')->with('blocks', $blocks);
}