Skip to content
This repository has been archived by the owner on Mar 23, 2020. It is now read-only.

9. Custom Function Libraries

Nathan Fiscaletti edited this page Jul 16, 2018 · 2 revisions

You can add custom function libraries in src/Synful/App/Functions.

Note: These function libraries will be loaded before anything else.


Example

src/Synful/App/Functions/MyFunctionLib.php

<?php

if (! function_exists('my_custom_function')) {
    /**
     * A custom function
     */
    function my_custom_function()
    {
        return 'this is a custom function';
    }
}

You can now call my_custom_function from anywhere in your project.


Next: CORS