MVC-ASSIGNREF-001
$this->assignRef('item', $item)
assignRef() on views
assignRef was a PHP 4 leftover. It does nothing useful on Joomla 4+.
$this->assignRef('item', $item) → $this->item = $item
What you will see
- Call to undefined method ...::assignRef
Symptoms people search
view variables empty · assignRef
Replace this code
Swap $this->assignRef('item', $item) for $this->item = $item.
Joomla 3
Remove or stop calling this
$this->assignRef('items', $items);Joomla 4 / 6
Use this instead
$this->items = $items;How to fix it
- 1Assign properties directly.
Also known as
assignRef
Related issues
- Joomla 4 → 5JavaScript
addScript() / addStyleSheet() vs WebAssetManager
$doc->addScript() → WebAssetManager + joomla.asset.json
- Joomla 4 → 5Templates
Template without joomla.asset.json
templateDetails.xml only → joomla.asset.json + WebAssetManager in index.php
- Joomla 3 → 4MVC
getError() / setError() on models and tables
$model->setError() → Exceptions
- Joomla 5 → 6MVC
Table::getInstance()
JTable::getInstance('Content') → MVC / Table factory
- Joomla 3 → 4PHP
JArrayHelper
JArrayHelper → Joomla\Utilities\ArrayHelper
- Joomla 3 → 4Joomla API
JAccess::getActions()
JAccess::getActions() → Access::getActionsFromFile() / getActionsFromData()