Updated template class for CMS
The class name, why template? Template is much better and follows the naming convention in all sane languages (oook, i know it's PHP :()

Where are $db and $functions? You missed to declare them in the class

class template
{
   private $db;
   private $functions = [];


Your

$query = $this-&gt;db-&gt;connection-&gt;prepare( 'SELECT id FROM ' . $this-&gt;functions-&gt;prefix( 'pages' ) . ' where id = ?' );


You use prepared statement for where id = ? but now for $this-&gt;functions-&gt;prefix( 'pages' ) it makes the prepared statement useless.

The same for fetchPage, getTheme.

As user45891 said, your $query-&gt;close() will never be executed due to the return. You can improve this with:

$query-&gt;close();
return $query-&gt;numRows &gt; 0;


This block

if ( ! $query )
{
    throw new Exception( $query-&gt;error(), 1 );
}


Great, i love Exceptions but what about a more specific exception? When i write PHP code i check this list to know which exceptions php have. What about UnexpectedValueException or LogicException. LogicException should be used when the error in your code, if $query is false it means you DB is OFF or your question is wrong so the problem should be in your code.

Anyway, your check should go before you use $query! because it will fails with

 $query-&gt;bind_param( 's', $theme );




while ( $query-&gt;fetch() )
{
   return $result;
}


You need only the first value? Well, what about 

$query-&gt;fetch();
return $result;


?

Anyway, you don't close $query in every function.

Your handlePageLoad don't return everytime, only if it joins $this-&gt;pageExist( $id ) path. Maybe you want to add return false;?

You could improve the this code with this:

public function handlePageLoad( $id )
{
    if ( $this-&gt;pageExist( $id ) )
    {
        $this-&gt;fetchPage( $id );
        $this-&gt;loadPage();
        $this-&gt;parseParameters();
        return true;
    }

    $this-&gt;fetchPage( 404 );
    $this-&gt;loadPage();
    $this-&gt;parseParameters();
    //header('Location: index.php?page=404');
    echo '! &lt;br /&gt; He\'s a true genius.';
    return false;
}


The indentation of parseParameters is not coerent with the other code (and ugly :()

As i said above, you missed to declare fields in your class. Do it! You will need to remember what fields you use and what fields your class have (and your IDE will help you more!)

How you handle the case where someone uses the same name for lang and template data?

Your parseParameters feels to be very slow with many arguments... what about RegEx?

Why you use three different arrays parameter, langParameters and templateData (except this which is filled by another method) ? They do the same thing? What about only one array?

You need it separate?



I don't use PHP everyday (only when i need to) so i'm not sure, so don't take it serious:

In getTheme you used $theme = 'theme'; because bind_param wants references ok, but what about &amp;"theme"? I'm not sure, but you could try

Anyway, good luck!