Перехожу по ссылке: /bitrix/services/main/ajax.php?action=modulename.Item.view&id=1
В ответ получаю:
{
"status": "error",
"data": null,
"errors": [
{
"message": "Could not find description of Item.view in Bitrix\\Main\\Engine\\DefaultController",
"code": 22002,
"customData": null
},
{
"message": "[Bitrix\\Main\\SystemException] \nCould not find description of Item.view in Bitrix\\Main\\Engine\\DefaultController (22002)\n/home/u/ulkru/public_html/bitrix/modules/main/lib/engine/controller.php:659\n#0: Bitrix\\Main\\Engine\\Controller->create(string)\n\t/home/u/ulkru/public_html/bitrix/modules/main/lib/engine/controller.php:410\n#1: Bitrix\\Main\\Engine\\Controller->run(string, array)\n\t/home/u/ulkru/public_html/bitrix/modules/main/lib/httpapplication.php:139\n#2: Bitrix\\Main\\HttpApplication->runController(object, string)\n\t/home/u/ulkru/public_html/bitrix/modules/main/lib/httpapplication.php:106\n#3: Bitrix\\Main\\HttpApplication->run()\n\t/home/u/ulkru/public_html/bitrix/modules/main/services/ajax.php:29\n#4: require(string)\n\t/home/u/ulkru/public_html/bitrix/services/main/ajax.php:1\n----------\n",
"code": 0,
"customData": null
}
]
}
lib/Controller/item.php
<?php
namespace Modulename\Controller;
use \Bitrix\Main\Error;
class Item extends \Bitrix\Main\Engine\Controller
{
public function addAction(array $fields):? array
{
return ['kek'];
}
public function viewAction($id):? array
{
return ['kekekekek'];
}
}
.settings.php
<?php
return [
'controllers' => [
'value' => [
'defaultNamespace' => '\\Modulename\\Controller',
],
'readonly' => true,
]
];
Где может быть ошибка?