本文整理汇总了PHP中Block::run方法的典型用法代码示例。如果您正苦于以下问题:PHP Block::run方法的具体用法?PHP Block::run怎么用?PHP Block::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Block
的用法示例。
在下文中一共展示了Block::run方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
* который выполняется до загрузки HTML, вывод данных в этом блоке делать
* не надо
*/
Block::run('PRE');
});
Observer::observe('frontpage_after_render', function () {
/**
* Запуск метода в виджетах текущей страницы
* Model_Widget_Decorator::after_page_load
*/
Observer::notify('after_page_load');
/**
* Блок служит для помещения в него виджета с произволным PHP кодом,
* который выполняется после загрузки HTML
*/
Block::run('POST');
});
Observer::observe('view_page_edit_plugins', function ($page) {
$blocks = Widget_Manager::get_blocks_by_layout($page->layout());
echo View::factory('widgets/page/edit', array('page' => $page, 'pages' => Model_Page_Sitemap::get(TRUE)->exclude(array($page->id))->flatten(), 'widgets' => Widget_Manager::get_widgets_by_page($page->id), 'blocks' => Arr::get($blocks, $page->layout())));
});
Observer::observe('page_add_after_save', function ($page) {
$post_data = Request::current()->post('widgets');
if (!empty($post_data['from_page_id'])) {
Widget_Manager::copy($post_data['from_page_id'], $page->id);
}
});
Observer::observe('page_edit_after_save', function ($page) {
$post_data = Request::current()->post('widget');
if (!is_array($post_data)) {
return;
示例2: addBlock
/**
* Adds a Block to the grid at the given position.
*
* @param Block $block Block object to be added at the grid
* @param int $row Block row in the grid
* @param int $column Block column in the grid
* @param int $position Block position in the cell
*
* @return Grid grid object
*/
public function addBlock(Block $block, $row, $column, $position)
{
// Process the block and build the block HTML.
$block->run($this->context->getRequest(), $this->context->getResponse());
// Set default row if not given.
if (!$row) {
$row = 1;
}
// Set default column it not given.
if (!$column) {
$column = 1;
}
// Set default position inside the cell if not given.
if (!$position) {
$position = 1;
}
// Set block name.
$block_name = 'block_' . $row . '_' . $column . '_' . $position;
$this->set($block_name, $block);
$this->blocks[$row][$column][$position] = $block_name;
return $this;
}
示例3: date
</title>
<link><?php
echo BASE_URL;
?>
</link>
<atom:link href="<?php
echo BASE_URL;
?>
/rss.xml" rel="self" type="application/rss+xml" />
<language>en-us</language>
<copyright>Copyright <?php
echo date('Y');
?>
, kodicms.ru</copyright>
<pubDate><?php
echo date('r');
?>
</pubDate>
<lastBuildDate><?php
echo date('r');
?>
</lastBuildDate>
<category>any</category>
<generator>KodiCMS</generator>
<description>The main news feed from KodiCMS.</description>
<docs>http://www.rssboard.org/rss-specification</docs>
<?php
Block::run('body');
?>
</channel>
</rss>
示例4:
echo $page->title();
?>
</h1>
</div>
<?php
Block::run('body');
?>
<?php
Block::run('pagination');
?>
<?php
Block::run('extended');
?>
</div>
<div class="col-md-3">
<?php
Block::run('sidebar');
?>
<?php
Block::run('recent');
?>
</div>
</div>
<?php
Block::run('footer');
?>
</div> <!-- end #page -->
</body>
</html>
示例5: block
protected function block($name)
{
Block::run($name);
}