contributions/page.blocks/controller/base/templated.full.block.cls.php
Go to the documentation of this file.00001 <?php 00002 require_once dirname(__FILE__) . '/templated.parameterized.block.cls.php'; 00003 00004 /** 00005 * A block that renders itself only from a template and can be passed parameters. 00006 * 00007 * The blocks name is by default taken from the template: Its the templates file name, 00008 * converted to plain ascii. E.g. for a template "news/blocks/teaser", the name would be 00009 * "news-blocks-teaser". 00010 * 00011 * Block title by default is empty and must be set through template. 00012 * 00013 * The block instance is available as $block within the template. So you may change title or 00014 * name like this: 00015 * 00016 * @code 00017 * $block->set_title('New title'); 00018 * $block->set_name('newname'); 00019 * @endcode 00020 * 00021 * @ingroup Blocks 00022 * @author Gerd Riesselmann 00023 */ 00024 class TemplatedFullBlock extends TemplatedParameterizedBlock { 00025 /** 00026 * Constructor 00027 * 00028 * @param string $template The template to render 00029 * @param array $params Assoziative array that gets passed to the view 00030 * @param integer $index The block's index. A block with lowest index will be displayed first 00031 * @param enum $position Where the block is to be displayed. 00032 */ 00033 public function __construct($template, $params = array(), $index = 1000, $position = self::LEFT) { 00034 parent::__construct(String::plain_ascii($template, '-'), '', $template, $params, $index, $position); 00035 } 00036 00037 }