Answer the question
In order to leave comments, you need to log in
Why "Class 'Ras\CVas' not found (0)"?
Good afternoon,
I'm making a module.
created file /local/modules/ras.vas/lib/fvas.php
namespace Ras;
class CFvac
{
function hello(){
echo "hello";
}
}
<?
use \Bitrix\Main\Config\Option;
use \Bitrix\Main\ArgumentNullException;
\Bitrix\Main\Loader::registerAutoloadClasses(
'ras.vas',
array(
'CFvac' => 'lib/fvas.php'));
?>
\Bitrix\Main\Loader::registerAutoloadClasses
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("");?><?$APPLICATION->SetTitle("Рейтинг");?> <br>
<?
use Ras/CFvac;
if (CModule::IncludeModule("ras.vas")){
echo "1"; //выводит, на странице bitrix/admin/partner_modules.php?lang=ru модуль установлен.
CFvac::hello(); //ошибка--Class 'Ras\CVas' not found (0)
}
?>
<br><?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question