1. Go to this page and download the library: Download roelofjan-elsinga/aloia-cms 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/ */
roelofjan-elsinga / aloia-cms example snippets
namespace App\Models;
use AloiaCms\Models\Model;
class PortfolioItem extends Model
{
protected $folder = 'portfolio_items';
protected $
use AloiaCms\Models\Article;
/**@var Article[]*/
$articles = Article::all();
use Carbon\Carbon;
$post_slug = 'this-post-is-amazing';
Article::find($post_slug)
->setExtension('md') // md is the default, but you can use html as well.
->setMatter([
'description' => 'This post is about beautiful things',
'is_published' => true,
'is_scheduled' => false,
// Either use post_date in setMatter() or setPostDate()
'post_date' => date('Y-m-d')
])
->setPostDate(Carbon::now())
->setBody('# This is the content of an article')
->save();