Browse Source

Update controller config.

pull/3/head
Ned Zimmerman 7 years ago
parent
commit
351d65d3bc
No known key found for this signature in database
GPG Key ID: FF56334A013120CA
  1. 14
      app/controllers/Home.php
  2. 1
      resources/assets/config.json
  3. 3
      resources/views/index.blade.php

14
app/controllers/Home.php

@ -6,13 +6,13 @@ use Sober\Controller\Controller;
class Home extends Controller class Home extends Controller
{ {
function sidebar_count() { function block_count() {
$c = 0; $c = 0;
foreach(['home-block-one', 'home-block-two', 'home-block-three', 'home-block-four', 'home-block-five'] as $block) { foreach(['home-block-one', 'home-block-two', 'home-block-three', 'home-block-four', 'home-block-five'] as $block) {
if (is_active_sidebar($block)) { if (is_active_sidebar($block)) {
$c++; $c++;
} }
} }
return $c; return $c;
} }
} }

1
resources/assets/config.json

@ -15,7 +15,6 @@
"watch": [ "watch": [
"app/**/*.php", "app/**/*.php",
"config/**/*.php", "config/**/*.php",
"resources/controllers/**/*.php",
"resources/views/**/*.php" "resources/views/**/*.php"
] ]
} }

3
resources/views/index.blade.php

@ -1,8 +1,7 @@
@extends('layouts.app') @extends('layouts.app')
@section('content') @section('content')
@debug('controller') @debug('dump')
{{ $sidebar_count }}
@if(is_active_sidebar('home-block-one') && is_active_sidebar('home-block-two')) @if(is_active_sidebar('home-block-one') && is_active_sidebar('home-block-two'))
<div class="one-two"> <div class="one-two">
@endif @endif

Loading…
Cancel
Save