folderweb/README.md
2025-10-02 16:54:47 +02:00

2.4 KiB
Raw Blame History

PNP (Plug'n Play) - A 'just enough' PHP framework for simple websites

HTML lacks native support for including repeating elements, like the site header and footer. By using PHP sparsely, we can add this feature and some other modern conviniences, while providing a nearly maintanance-free framework that will chugh along for years, possibly decades, by avoiding a bunch of rapidly changing components and dependencies. Since reasonably up-to-date PHP versions is available at the vast majority of shared hosting providers, it makes sence to combine HTML with PHP.

The mission statement is to apply just enough PHP to make the core features work. No admin panel, just an intuitive folder-based workflow. Intuitive defaults are applied, with optional overrides and customizations.

Main features from the users perspective

  • The user should be able to create a new folder and drop in a markdown, PHP or HTML file and have it rendered imediatly. The directory hierarchy dictate the URL, for example /www/articles/2025/10-23-title-of-article/article.md would translate to the following URL: domain.tld/articles/2025/-10-23-title-of-article/.
  • The user can drop images and files in a directory and use them as assets. If a user drops a jpeg or webp into the folder mentioned above, the image can be refferenced in the markdown, like so: `!alt text for the image. The image will be renderend inline in the text. The same goes for PDF's or other document files, only they will not be rendered, but can be linked to.
  • If a directory contains one or more subfolders, it is assumed that it is a parent folder containing multiple instances of the same type of content, for example a list of articles, blog posts and so on. A default list view will be applied showing title and date, but the view can be overriden and defined for each content type / folder.

Main features from a developers perspective

  • The code is readable and adds nothing more than strictly neccessary
  • Only HTML, PHP and CSS is allowed no JS!
  • Sparsely commented, only the main sections
  • Custom templates is located at /app/custom
  • Third party scripts are added to /app/vendors
  • Supports PHP 8.3+ and makes use of modern PHP features whenever possible
  • Uses a PHP to make a simple router
  • Uses .htaccess to make the PHP router handle all requests.
  • The HTML is classles and highly compliant with best practices
  • The CSS uses modern features to apply styles as effective and smart as possible