1. Go to this page and download the library: Download justinholtweb/craft-yo library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
justinholtweb / craft-yo example snippets
use justinholtweb\yo\Yo;
Yo::success('Saved.');
Yo::say('Import finished')
->body('412 entries in, 3 skipped.')
->success()
->action('Review the log', url: '/admin/transport/logs/88')
->to('group:editors')
->dedupe('transport:import')
->send();
use justinholtweb\yo\services\Messages;
use justinholtweb\yo\events\DeliveryEvent;
// Learn what became of a message you sent.
Event::on(Messages::class, Messages::EVENT_MESSAGE_ACTIONED, function(DeliveryEvent $e) {
if ($e->actionKey === 'retry') {
MyPlugin::getInstance()->imports->retry($e->message->context['importId']);
}
});
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.