Setting a title for every page PHP
<p>I am trying to use the constructor to put a title on every page unless I specify what the title should be for the specific page...</p>

<p>For the How it Works page.. the title should be "TeamPlayer - How it works!" (Which currently works)
For the FAQ page the title should be "TeamPlayer" (Which currently doesn't work).</p>

<p>I don't want to have to put the $data['title'] = 'TeamPlayer'; in every function. How do I fix my problem?</p>

<pre><code>    function __construct()
    {
        parent::__construct();
        $data['title'] = 'TeamPlayer';
    }

public function howitworks()
{
        $data['title'] = 'TeamPlayer - How it works!';
        load_page('howitworks', $data);
}

    public function faq()
{
        load_page('faq', $data);

}
</code></pre>

<p>EDIT:::</p>

<p>I don't understand how I can be more descriptive in my problem.. To help those trying to help... Here is how I am echoing my titles in my views. I tried using some of the solutions provided but could not get them to function within my controllers</p>

<pre><code>&lt;title&gt;&lt;?php echo $title; ?&gt;&lt;/title&gt;
</code></pre>
