No Code Attached Yet
avatar alehei3333333
alehei3333333
1 Feb 2022

What needs to be fixed

Why this should be fixed

How would you fix it

Side Effects expected

avatar alehei3333333 alehei3333333 - open - 1 Feb 2022
avatar joomla-cms-bot joomla-cms-bot - change - 1 Feb 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 1 Feb 2022
avatar alehei3333333
alehei3333333 - comment - 1 Feb 2022

Wrote a trial component

schooltech.xml
`

<name>SchoolTech</name>
<!-- Следующие элементы являются необязательными и не содержат ограничений на форматирование -->
<creationDate></creationDate>
<!-- Фиктивный автор, не стесняйтесь заменять его в любом месте, где вы его видите -->
<author>MuCompani</author>
<authorUrl></authorUrl>
<copyright></copyright>
<license></license>
<!-- Строка 'version' записывается в таблицу компонентов -->
<version>0.1</version>
<!-- Описание является необязательным и по умолчанию используется имя сомпонента -->
<description>
    Контент для сайта
</description>

<!-- Это пространство имен PHP, в котором организован
код расширения. Он должен следовать этому формату:

Vendor\Component\ComponentName

"Vendor" может быть названией компании или вашим собственным именем

Раздел "ComponentName" ДОЛЖЕН соответствовать имени, используемому
везде для вашего компонента. Каким бы ни было имя этого XML-файла,
пространство имен должно совпадать (заглавные/прописные буквы не учитываются).
-->
<namespace path="src/">MuCompani\Component\SchoolTech</namespace>
       
<administration>
    <!-- Ссылка, которая появится в меню админки Joomla "Components" -->
    <menu link="index.php?option=com_schooltech">SchoolTech</menu>
    <!-- Список файлов и папок для копирования.
         Обратите внимание на атрибут "folder".
         Это имя папки в пакете компонентов для копирования в CMS Joomla 4. -->
    <files folder="admin/">
        <folder>services</folder>
        <folder>src</folder>
        <folder>tmpl</folder>
    </files>
</administration>

`

admin/services/provider.php
`

registerServiceProvider(new MVCFactory('\\MuCompani\\Component\\SchoolTech')); $container->registerServiceProvider(new ComponentDispatcherFactory('\\MuCompani\\Component\\SchoolTech')); $container->set( ComponentInterface::class, function (Container $container) { $component = new MVCComponent($container->get(ComponentDispatcherFactoryInterface::class)); $component->setMVCFactory($container->get(MVCFactoryInterface::class)); return $component; } ); } }; ` admin/src/Controller/DisplayController.php `

TEST

`

I collect com_schooltech.zip in the archive, install it. When I try to enter the component in the admin panel, I get

"404 Could not find view [name, type, prefix]: schooltemplate, HTML, Administrator."

At the same time, with a stupid rewrite from the example at the link below, everything works fine. But it is worth trying to replace the values ​​​​with those that I have and we get the above error. Am I misunderstanding something? Is there something not the name of files / folders, but something systemic?

https://mb4.ru/cms/joomla4/724-developing-a-basic-component-for-joomla-4.html

avatar b2z
b2z - comment - 1 Feb 2022

This should be closed as not related to CMS at all

avatar chmst chmst - close - 1 Feb 2022
avatar chmst
chmst - comment - 1 Feb 2022

@alehei3333333 please ask such questions in forum.joomla.org, this is for issues with the joomla core. So closing.

avatar chmst chmst - change - 1 Feb 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-02-01 08:26:10
Closed_By chmst

Add a Comment

Login with GitHub to post a comment