October CMS resources and help articles

Simple and to the point. Optimized by the community.

How to define global functions in October CMS

0
by mjauvin, last modified on March 16th, 2021

I've seen this question asked over and over again, and just found how to do this cleanly and easily with October...

Just add a file called "init.php" within your plugin's root:

init.php:

<?php

function myGlobalFunction()
{
    return "Hello World!";
}

Discussion

0 comments

We use cookies to measure the performance of this website. Do you want to accept these cookies?