Download the PHP package roelofjan-elsinga/flat-file-cms without Composer

On this page you can find all versions of the php package roelofjan-elsinga/flat-file-cms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package flat-file-cms

Aloia CMS

CI StyleCI Status Code Coverage Total Downloads Latest Stable Version License

This package contains a drop-in CMS that uses files to store its contents.

For the full documentation, go to the Aloia CMS Documentation website.

Installation

You can include this package through Composer using:

and if you want to customize the folder structure, then publish the configuration through:

Creating a custom content type

Creating a custom content type is very simple. All you have to do is create a class that extends AloiaCms\Models\Model, specify a $folder_path, and optionally add required fields to $required_fields. An example can be found below:

Once you have a class like this, you can interact with it like described under "Usage of models"

Built-in models

There are 4 built-in models which you can use without any additional set-up:

Of course, you can add your own models as described at "Creating a custom content type".

Usage of models

In this example we're looking at one of the built-in content types: Article. You can use these same steps for all classes that extend from "AloiaCms\Models\Model".

To load all articles in the "articles" folder in the folder you specified in config('aloiacms.collection_path') you can use the following script:

You can use that to display your posts on a page. You can also load a single post, using:

If you only want all published posts, you'll need to retrieve them like so:

To get the raw contents of each article (content + front matter), you can use:

And finally, to update your article, you can run:

Content blocks

You can manage small content blocks for your website through this package.

The content of the blocks are stored in a folder called "content_blocks" inside of the config('aloiacms.collections_path') folder.

You'll need to register the facade into your application, by placing the following line to your aliases in config/app.php:

Now you can use the facade in your blade views by using:

This facade will look for a file in the folder you specified in config('aloiacms.collections_path'). The Facade will parse the contents of the file to HTML to be able to render it. If no file could be found, an empty string will be returned.

NOTE: You should not specify the extension of the filename you're passing to Block::get(). This will be parsed automatically.

Testing

You can run the included tests by running ./vendor/bin/phpunit in your terminal.

Contributing

If you'd like to contribute to the CMS directly, you can create PR's on this repository. If you'd like to contribute to the documentation, you can create PR's on the repository for the documentation.


All versions of flat-file-cms with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-dom Version *
roelofjan-elsinga/content-to-html-parser Version ^0.5
illuminate/support Version ^8.0|^9.0|^10.0
illuminate/console Version ^8.0|^9.0|^10.0
spatie/yaml-front-matter Version ^2.0
symfony/yaml Version ^6.0
roelofjan-elsinga/sitemap-generator Version ^0.5.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package roelofjan-elsinga/flat-file-cms contains the following files

Loading the files please wait ....