Joomla 3 - What to use instead of assignRef?

删除回忆录丶 提交于 2019-11-30 18:04:16

问题


In my project I have this method in my view:

public function elegirSeleccionados(){
    $this->assignRef('pagination', $this->get('pagination'));
    $this->assignRef('items', $this->get('recientes'));
    $this->assignRef('list', $this->get('list'));
    parent::display();
}

assignRef is deprecated / removed in this Joomla 3.

What should I use instead?


回答1:


assignRef() and assign() are not needed anymore, since Joomla 1.6+ requires at least PHP 5.2 (PHP5 uses assign by reference).

Use in view.html.php

$this->pagination = $this->get('pagination')

and in the template just call $this->pagination.

To get your skills up to date check the official Joomla! Documentation




回答2:


txs for this, but in my view (default.tpl) zeh val will not been shown

view.html.php

$this->my_string = "ledl";
<br>
return parent::display($tpl);

default.tpl

<bold>{$this->my_string}</bold>


来源:https://stackoverflow.com/questions/14883180/joomla-3-what-to-use-instead-of-assignref

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!