Download Latest Version CI4-CMS.zip (69.2 MB)
Email in envelope

Get an email when there's a new version of codeigniter4CMS

Home
Name Modified Size InfoDownloads / Week
README.md 2025-10-25 7.5 kB
CI4-CMS.zip 2025-10-25 69.2 MB
LICENSE.txt 2024-10-14 1.1 kB
example-config-files.zip 2024-10-02 7.7 kB
Totals: 4 Items   69.3 MB 2

A very light blog engine CMS alternative to W.P using Codeigniter 4.6.3 Bootstrap 5. and Sqlite3 database. There is a grunt file in the web root to work with scss and update everything including in the browser, as you go using "grunt watch"

. Breakpoints are included in the style sheets, so CI4-CMS is mobile responsive. The main view file is webLayout.php and is found in app/Views. This file contains really everything needed, the header and footer stuff , but leaves out the specific page content of individual web pages. For individual web pages they leverage the use of the main webLayout.php as follows:

extend('webLayout') ?>
section('content') ?>

text for individual web page inserted between the starting content tag above, and end section below

endSection()?>

For more on using CodeIgniter4 layout templates see: Layouts

I've added some content security policy via a meta tag in the main webLayout (line 9 of webLayout.php) view but i've commented it out since it seems to block the debug bar . It can be un-commented when web moves from development to production

Because with incremental updates for the CodeIgniter4 can cause breaking changes, i have fixed the CodeIgniter4 version in the Composer.json file to 4.6.3 with the line
"codeigniter4/framework": "4.6.3"

To update edit that line in Composer.json to the next release, run the command from a terminal :
composer update
and then follow instructions at : Upgrading From a Previous Version

Now to make things easier i have set up a user (with role of admin powers ) as follows:

User : Demo
Password : Demo

For ease to play with system ive put login into the navbar, you can remove that on moving to production; at which point remember that to get to the login the URL is :

So enter those into text box at this :

http://domain/blackcat

You should then see :

The password is encrypted before its stored in database. The code will check if what you enter into the login textbox whether it matches the password (that is encrypted ) in the database.

Once logged in, your are taken to the admin page, where you can change the user name and password to something else . Your new admin user handle and password will replace the old ones .They wont work until you hit the logout link, to log out and lg back in using new credentials

The link to do that is called "resetAdminPw" .

If you get things working on local dev, you can just zip up everything and load to your live hosting as appropriate thats what i did .This is the directory structure of a live working website using CI4-CMS

Basically the name of the sub directory will be the same as your domain name you want something like myWeb.com.

From from my cPanel hosting i just added a new domain name; set up add domain/subdomain and edited so that document root of my web is pointing at the public directory

As you can see , i simply make the public directory , the web document root. There is no need to mess about with the .htaccess file except when you want to install SSL i.e use secure socket(https) on your web instead of not secure (http) by leveraging "lets encrypt".

IN which case in the .htaccess file in public change top line below to bottom line

RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]

Other things you need to do are development to production. If you read the codeIgniter docs, you will know that you need to switch to production mode .You can do that by changing development to production in this line of the .env file

CI_ENVIRONMENT = development

also change your web address to domain name in

the line number 20 :  
public string $baseURL = 'http://localhost:8080'; <br>

Database is sqlite3 , which is just a file, so no messing about with setting up MySQl needed

you will need to edit the controller Sendmail.php in controllers with credentials for sending out an email, and email address to where you want the email, containing data submitted by web surfer using "Contact Us" from menu.

My web as all using subdomains and cant use the main domain email. So if you look at lines from 99 in Sendmail.php you can see im using my personal Google email , to send data submitted from the contact us form to another of my emails infact a yahoo one. A link below gives you info and tutorial on PHPMailer

For licence CodeIgniter is using a MIT one. For me you are granted all permissions to do what you want

To see whats in the database called Art.db located at in directory "writable" , you can browse data if you install sqlitebrowser. You can right click on Art.db "open with" or launch sqlitebrowser from a command line eg:

[andrew@darkstar ~]$ sqlitebrowser

and navigate to Art.db using file->navigate to webroot writable

sqlitebrowser should be in your repo eg

[andrew@darkstar ~]$ pacman -Ss sqlitebrowser extra/sqlitebrowser 3.12.2-3 [installed] SQLite Database browser is a light GUI editor for SQLite databases, built on top of Qt

Read about sqlitebrowser at :

Sqlite Browser

Gruntfile.js is present ,so its set up for development to convert custom.scss using grunt which will put css where it should be in public/custom.csss . Try using npm install to repopulate node_modules , after installing nodejs and grunt system wide. . See https://gruntjs.com/

Forum for CodeIgniter is : [CodeIgniter Forum]https://forum.codeigniter.com/ my handle is captain-sensible on there

any issues you can try me at andybrookestar@gmail.com

In the blog creation form , don't put html tags around text in title input field, just put title name. Thats because style for blog title is already coded in.edit the contoller Sendmail.php to use your email that will send message ( ijust use gmail) and the email address of admin where you want message to go

see below for example tutorial of PHPMailer

[PHPMailer]https://github.com/PHPMailer/PHPMailer/wiki/Tutorial

The Gruntfile.js is at web root :

commands to use are:

'grunt sass'
'grunt watch'

The command grunt sass does a one time conversion of scss code of custom.scss to custom.css and places the custom.css in the right place (public/css).

grunt watch will keep looking for changes in the scss code , convert and update the custom.css file.

But you will need to install stuff system wide ; you will need to have nodejs, grunt-cli in my case on Arch ruby
installed system wide and then project wise from a command line , with context location web root :

$npm init
$npm install

for grunt see See https://gruntjs.com/

Forum for CodeIgniter is : https://forum.codeigniter.com/

any issues you can try me at andybrookestar@gmail.com

If you want to have a go with CodeIgniter4 web development with Arch Linux, this book might help : Arch Linux

Source: README.md, updated 2025-10-25