philsturgeon / codeigniter-template

Template library for CodeIgniter which supports modules, themes, partial views, etc.
411 stars 178 forks source link

problem with Template and the new CI 3.0-dev #35

Closed zaherg closed 9 years ago

zaherg commented 12 years ago

hi, i have just downloaded the new CI-3.0-dev ( 24/05/2012 ) and when i run my application i got this error :

A PHP Error was encountered
Severity: Runtime Notice

Message: Only variables should be assigned by reference

Filename: libraries/Template.php

Line Number: 281

which is

$title_segments =& func_get_args();

and remove it will cause the title to show the only title which we have passed inside the function controller, not even the one inside the constructor ..

dambridge commented 12 years ago

Got the same issue here.

zaherg commented 12 years ago

i just update it to the new code, but it didnt work .. same issue .. i only see one title unless i set the title in the same controller twice ..

jonsuh commented 12 years ago

You can fix this issue by the following (starting at line 278):

public function title()
{
    if (func_num_args() >= 1)
    {
        $title_segments = func_get_args();
        $this->_title = implode($this->_title_separator, $title_segments);
    }

    return $this;
}
zaherg commented 12 years ago

i have the latest code ( including the one you posted ) and it didnt work ..

<?php

    public function __construct()
    {
        parent::__construct();
        $this->template->title('test');
    }

    // ------------------------------------------------------------------------

    public function index()
    {
        $this->template->title('Users Management');
        .....etc
    }

the index function will only show 'Users Management'... just a note that am using MX HMVC for this project ..

tanapop commented 9 years ago

Thanks. mr.jonsuh

secrethash commented 9 years ago

Hey @linuxjuggler , did you find the solution for the problem?

kriskornel commented 6 years ago

Thanks mr @jonsuh it work for me