This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/_sakura/components/News.php

22 lines
357 B
PHP
Raw Normal View History

<?php
/*
* The news page backend
*/
namespace Sakura;
class News {
// Posts array
public $posts = [];
// Initialise the news object
function __construct($category) {
// Get the news posts and assign them to $posts
$this->posts = Database::fetch('news', true, ['category' => [$category, '=']], ['id', true]);
}
}