TemplatePower Forum Forum Index TemplatePower Forum
Ask your question about TemplatePower here!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

handling for missing blocks?

 
Post new topic   Reply to topic    TemplatePower Forum Forum Index -> Feature request/Discussion
View previous topic :: View next topic  
Author Message
ikkedikke



Joined: 25 Jul 2006
Posts: 2

PostPosted: Tue Jul 25, 2006 3:28 pm    Post subject: handling for missing blocks? Reply with quote

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 );
?>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    TemplatePower Forum Forum Index -> Feature request/Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group