ikkedikke
Joined: 25 Jul 2006 Posts: 2
|
Posted: Tue Jul 25, 2006 3:28 pm Post subject: handling for missing blocks? |
|
|
I wrote this in order to "solve" the error's when there's a block missing although there must be a better solution.
| Code: |
<?php
function newBlock( $blockname )
{
if(!isset( $this->parent[$blockname],$this->parent[$blockname],$this->content[ $this->parent[$blockname] .'_'. $this->index[$this->parent[$blockname]] ]))
{
trigger_error('TP: The block"'.$blockname.'" isn't defined in the current templatefile/subblock');
}
else
{
$parent = &$this->content[ $this->parent[$blockname] .'_'. $this->index[$this->parent[$blockname]] ];
$lastitem = sizeof( $parent );
?>
|
|
|