<< Back

Introducing The Article Class

Posted on Sunday 7th October 2018

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.

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


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 git@github.com:christopher-paul-shaw/Article.git

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