Christopher Shaw

Software Developer
Introducing The Article Class
Date: 2018-10-07 Category: Code

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 ( 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