TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
Indirect modification of overloaded property Model_Test::$title has no effect
  • Hello. Is it a bag or a new syntax:

    $t = ORM::factory('Test',array('alias'=> $id));
    if($service->loaded()){
        $this->template->content = View::factory('test/view')
                        ->bind('title', $t->title);
            }else{

    This code execute Notce: Indirect modification of overloaded property Model_Test::$title has no effect but in kohana 3.2 with PHP 5.0 all is right.
    So I write next code and get success:

    $t = ORM::factory('Test',array('alias'=> $id));
    if($service->loaded()){
    $title = $t->title;
        $this->template->content = View::factory('test/view')
                        ->bind('title', $title);
            }else{

    Is it right to use?
    P.S. Sorry for english =) Used Kohana 3.3.1, PHP 5.4.20

  • ORM properties are magical. They can not be bound. Notice the & in the bind function below:

    https://github.com/kohana/core/blob/3.3/master/classes/Kohana/View.php#L314

    Try with set instead of bind and see if it solves your problem. Like this:

    $t = ORM::factory('Test',array('alias'=> $id));
    if($service->loaded()){
    $title = $t->title;
        $this->template->content = View::factory('test/view')
                        ->set('title', $title);
            }else{
    

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

  • enov February 2014