Новости Joomla

Как триггерить события для плагинов на манер Joomla 5+?В Joomla 6 должны удалить метод...

Как триггерить события для плагинов на манер Joomla 5+?В Joomla 6 должны удалить метод...

👩‍💻 Как триггерить события для плагинов на манер Joomla 5+?В Joomla 6 должны удалить метод triggerEvent(), с помощью которого раньше вызывались события для плагинов. Теперь чтобы в своём коде вызвать событие для плагина и получить от него результаты нужно:- создать объект класса события- передать в него параметры

use Joomla\CMS\Event\AbstractEvent;use Joomla\CMS\Factory;use Joomla\CMS\Plugin\PluginHelper;// Грузим плагины нужных группPluginHelper::importPlugin('system');// Создаём объект события$event = AbstractEvent::create('onAfterInitUniverse', [    'subject' => $this,    'data'    => $data, // какие-то данные    'article' => $article, // ещё материал вдовесок    'product' => $product, // и товаров подвезли]);// Триггерим событиеFactory::getApplication()->getDispatcher()->dispatch(    $event->getName(), // Тут можно строку передать 'onAfterInitUniverse'    $event);// Получаем результаты// В случае с AbstractEvent это может быть не 'result',// а что-то ещё - куда сами отдадите данные.// 2-й аргумент - значение по умолчанию, // если не получены результаты$results = $event->getArgument('result', []);
Плюсы такого подхода - вам не нужно запоминать порядок аргументов и проверять их наличие. Если вы написали свой класс события, то в плагине можно получать аргументы с помощью методов $event->getArticle(), $event->getData(), $event->getProduct() и подобными - реализуете сами под свои нужды. Если такой класс события написали, то создаёте экземпляр своего класса события и укажите его явно в аргументе eventClass
use Joomla\Component\MyComponent\Administrator\Event\MyCoolEvent;$event = MyCoolEvent::create('onAfterInitUniverse', [    'subject'    => $this,    'eventClass' => MyCoolEvent::class, // ваш класс события    'data'       => $data, // какие-то данные    'article'    => $article, // ещё материал вдовесок    'product'    => $product, // и товаров подвезли]);
Ожидаемо, что класс вашего события будет расширять AbsractEvent или другие классы событий Joomla.🙁 Есть неприятный нюанс - нельзя просто так вызывать событие и ничего не передать в аргументы. Аргумент subject обязательный. Но если вы всё-таки не хотите туда ничего передавать - передайте туда пустой stdClass или объект Joomla\registry\Registry.
@joomlafeed#joomla #php #webdev

0 Пользователей и 1 Гость просматривают эту тему.
  • 1 Ответов
  • 2037 Просмотров

administrator
« : 17.11.2010, 14:28:05 »
здравсвуйте! иду сайт/администратор
ввожу имя - админ, пароль - свой
заходит и выдает какую-то ошибку(короче не отображает админку)
а просто текст:
и все
помогите разобраться

Welcome to Joomla!

Congratulations on choosing Joomla! as your content management system. To help you get started, check out these excellent resources for securing your server and pointers to documentation and other helpful resources.

Security

On the Internet, security is always a concern. For that reason, you are encouraged to subscribe to the Joomla! Security Announcements for the latest information on new Joomla! releases, emailed to you automatically.

If this is one of your first Web sites, security considerations may seem complicated and intimidating. There are three simple steps that go a long way towards securing a Web site: (1) regular backups; (2) prompt updates to the latest Joomla! release; and (3) a good Web host. There are many other important security considerations that you can learn about by reading the Joomla! Security Checklist.

If you believe your Web site was attacked, or you think you have discovered a security issue in Joomla!, please do not post it in the Joomla! forums. Publishing this information could put other Web sites at risk. Instead, report possible security vulnerabilities to the Joomla! Security Task Force.

Learning Joomla!

A good place to start learning Joomla! is the "Absolute Beginner's Guide to Joomla!." There, you will find a Quick Start to Joomla! guide and video, amongst many other tutorials. The Joomla! Community Magazine also has articles for new learners and experienced users, alike. A great place to look for answers is the Frequently Asked Questions (FAQ). If you are stuck on a particular screen in the Administrator (which is where you are now), try clicking the Help toolbar button to get assistance specific to that page.

If you still have questions, please feel free to use the Joomla! Forums. The forums are an incredibly valuable resource for all levels of Joomla! users. Before you post a question, though, use the forum search (located at the top of each forum page) to see if the question has been asked and answered.

Getting Involved

If you want to help make Joomla! better, consider getting involved. There are many ways you can make a positive difference. Have fun using Joomla!.
Logged in Users
#    Name    Group    Client    Last Activity    Logout
1    admin    Super Administrator    administrator    0.0 hours ago    
Popular
Most Popular Articles    Created    Hits
Joomla! Overview    2008-08-09 07:49:20    150
Extensions    2008-08-11 06:00:00    102
Joomla! License Guidelines    2008-08-20 10:11:07    100
Welcome to Joomla!    2008-08-12 10:00:00    92
What's New in 1.5?    2008-08-11 22:13:58    92
Content Layouts    2008-08-12 22:33:10    70
Joomla! Features    2008-08-08 23:32:45    59
We are Volunteers    2007-07-07 09:54:06    54
The Joomla! Community    2008-08-12 16:50:48    52
Joomla! Facts    2008-08-09 16:46:37    50
Recent added Articles
Latest Items    Created    Creator
Joomla! License Guidelines    2008-08-20 10:11:07    Administrator
Content Layouts    2008-08-12 22:33:10    Administrator
The Joomla! Community    2008-08-12 16:50:48    Administrator
Welcome to Joomla!    2008-08-12 10:00:00    Administrator
Example Pages and Menu Links    2008-08-12 09:26:52    Administrator
Newsflash 4    2008-08-12 00:25:50    Administrator
Newsflash 5    2008-08-12 00:17:31    Administrator
What's New in 1.5?    2008-08-11 22:13:58    Administrator
I installed with my own language, but the Back-end is still in English    2008-08-11 17:18:14    Administrator
Does the PDF icon render pictures and special characters?    2008-08-11 17:14:57    Administrator
Menu Stats
Menu    # Items
ExamplePages    4
keyconcepts    3
mainmenu    9
othermenu    7
topmenu    4
usermenu    4
Joomla! Security Newsfeed

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 98304 bytes) in C:\Program Files\VertrigoServ\www\libraries\simplepie\simplepie.php on line 14650
*

ilma55

  • Захожу иногда
  • 198
  • 5 / 0
Re: administrator
« Ответ #1 : 17.11.2010, 15:20:41 »
Allowed memory size of 8388608 bytes exhausted...
Это сообщение об ошибке означает, что php не хватило отведенной оперативной памяти.

Пути решения:

1. Найти файл php.ini и изменить значение параметра memory_limit с 8М на большее, например 24М.

2. В файл .htaccess добавить следующую строку:
php_value memory_limit "24M"

Если ни один из способов не сработал - обращаться в службу поддержки хостинга.  Если и это не помогло - менять хостинг на человеческий.

UPDATE: 24М было актуально в начале 2008 года. В конце года WP требует 32М, а то и больше.

UPDATE 2: К концу 2009 года уже и 32М мало. Растем!
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Не могу попасть в administrator

Автор ierihon88

Ответов: 2
Просмотров: 1379
Последний ответ 11.06.2014, 18:14:52
от ierihon88
Как мне заходить в Менеджер Плагины через JXTC Administrator Lock

Автор majesty

Ответов: 4
Просмотров: 2511
Последний ответ 22.06.2012, 18:26:51
от majesty
Проблема при переименовании папки administrator.

Автор newuktus

Ответов: 7
Просмотров: 5159
Последний ответ 31.01.2012, 23:34:49
от igorksan
после установки сайта на сервер выскакивает 500 ошибка если набираешь имясайта/administrator

Автор samael_96

Ответов: 2
Просмотров: 1574
Последний ответ 25.05.2011, 21:37:03
от Taatshi
404 при переходе в http://сайт/administrator

Автор ws_green

Ответов: 11
Просмотров: 2655
Последний ответ 03.11.2010, 01:57:00
от Aleks_El_Dia