當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Block::all方法代碼示例

本文整理匯總了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);
 }
開發者ID:scrobot,項目名稱:backend-blocks,代碼行數:7,代碼來源:BlockController.php

示例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';
 }
開發者ID:scrobot,項目名稱:backend-blocks,代碼行數:15,代碼來源:BlocksServiceProvider.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');
});
開發者ID:fencer-md,項目名稱:stoticlle,代碼行數:31,代碼來源:routes.php

示例4: showBlocks

 public function showBlocks()
 {
     $blocks = Block::all();
     return View::make('backend.admin.config.blockslist')->with('blocks', $blocks);
 }
開發者ID:fencer-md,項目名稱:stoticlle,代碼行數:5,代碼來源:ContentController.php


注:本文中的Block::all方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。