PHP code example of seiger / sarticles

1. Go to this page and download the library: Download seiger/sarticles 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/ */

    

seiger / sarticles example snippets


/*
 * Set default value for sArticles field
 */
Event::listen('evolution.sArticlesManagerValueEvent', function($params) {
    $result = '';
    if ($params['type'] == 'article') {
        if ($params['field'] == 'description') {
            $result = '<p></p>';
        }
    }
    return $result;
});

/*
 * Add some html after the field
 */
Event::listen('evolution.sArticlesManagerAddAfterEvent', function($params) {
    $result = '';
    if ($params['type'] == 'idea') {
        if ($params['field'] == 'published_at') {
            $result = '';
        }
    }
    return $result;
});
console
php artisan package:install
console
php artisan vendor:publish --provider="Seiger\sArticles\sArticlesServiceProvider"
console
php artisan migrate