You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
699 B
37 lines
699 B
<?php |
|
|
|
namespace Aldine; |
|
|
|
use Sober\Controller\Controller; |
|
|
|
class Home extends Controller |
|
{ |
|
public function blockCount() |
|
{ |
|
$c = 0; |
|
foreach ([ |
|
'home-block-1', |
|
'home-block-2', |
|
'home-block-3', |
|
'home-block-4', |
|
'home-block-5' |
|
] as $block) { |
|
if (is_active_sidebar($block)) { |
|
$c++; |
|
} |
|
} |
|
return $c; |
|
} |
|
|
|
public function homeBlocks() |
|
{ |
|
$blocks = []; |
|
for ($i = 0; $i < 5; $i++) { |
|
if (is_active_sidebar("home-block-$i")) { |
|
$blocks[] = "home-block-$i"; |
|
} |
|
} |
|
|
|
return $blocks; |
|
} |
|
}
|
|
|