Home / Blog / Post
Introducing The Article Class
Added on 07th October 2018 in Project

What does Article Do?

It accesses files such as markdown files within a predefined directory, gets the content and other information and returns it back to the user with simple to use functions.

  • Lists Articles
  • Search Articles
  • Load By Filename
  • Load By Name
  • Can specify what extensions to work with.

The intent of this class is to be used in several projects which access articles, allowing the functionality to be quickly added rather than recreated each time.

Some Example Uses

  • Blog
  • Wiki


List / Search

use CPS\Article;

$dir = "./where/your/files/are";
$article = new Article($dir);
$results = $article->list("your term here");

Load (By Name or Filename);

use CPS\Article;

$dir = "./where/your/files/are";
$article = new Article($dir);
$results = $article->load("Article Name");

How to Install

1. Composer

The preferred method is using composer (https://getcomposer.org/) and can be installed using the following command

composer require christopher-paul-shaw/article 

2. Cloning

You can also clone the repository from github

git clone [email protected]:christopher-paul-shaw/Article.git

Url: https://github.com/christopher-paul-shaw/Article/

Hi there, I am christopher shaw, a software developer form South Yorkshire, England.

I love tinkering with all things tech, and opened this website as a web presence for myself and a place to keep my notes and snippets. Hopefully you will find something here to help

Christopher Shaw