Fatal error: Call to a member function set_filenames() on a non-object

Discussion in 'PHP' started by human, Sep 8, 2008.

  1. #1
    Hi,

    I have this problem. My code is
    <?php
       require_once('template.php'); 
     $template->set_filenames(array(
    "get" => "get.tpl"
    ));
    function write_link($url,$img){
    $url=rtrim($url);
    
    $template->assign_vars(array( 
    "IMG" => "$img",
    "URL" => "$url"
    )); 
    
    }
    $template->pparse('get');
    ?>
    PHP:
    (The unusable part of the code was deleted)
    But it gaves error.
    I have the file get.tpl .

    I'm using script like this on another page and it's running.




    P.S. Sorry for my bad English :)
     
    human, Sep 8, 2008 IP
  2. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Can you paste template.php?

    Where is your declaration:
    $template = New SOME_TEMPLATE_ENGINE;
    PHP:
    ?

    Jay
     
    jayshah, Sep 8, 2008 IP
  3. human

    human Peon

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I made it before your answer but thanks :)
     
    human, Sep 8, 2008 IP