Created
October 28, 2015 12:55
-
-
Save katzueno/24ba6a251a5e5ac4782b to your computer and use it in GitHub Desktop.
concrete5 特定ページで使用しているブロックのID取得
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$page = Page::getByID(1); // cID で指定したページのオブジェクトを指定 | |
$blocks = $page->getBlocks("Main"); // 指定した「Main」エリアのブロックの情報を取得 | |
if ($blocks) { | |
foreach($blocks as $block) { | |
echo h($block->bID) . ", "; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment