0

I have Model.php:

<?php
/**
* @package   ImpressPages
*/

namespace Plugin\My_plugin_name;

class Model
{
public static function getVideoList()
{
    $videos = ipDb()->selectAll('plugin_db', '*', array('language'=> ipContent()->getCurrentLanguage()->getCode()), 'ORDER BY row_number ASC');
    return $videos;
}

}

But when I try to call to this function in Widget/some_plugin/skin/view.php

$videos = Model::getVideoList();

I get:

Fatal error: Class 'Model' not found in .......Widget/some_plugin/skin/view.php

Nelo
  • 1

1 Answers1

1

I feel like I've already answered this question. You have to use full namespace:

$videos = \Plugin\MyPlugin\Model::getVideoList();
Bora
  • 10,529
  • 5
  • 43
  • 73
Mangirdas Skripka
  • 1,647
  • 1
  • 15
  • 14