• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space
  • Chevereto Support CLST

    Support response

    Support checklist

    • Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • Confirm that the server meets the System Requirements
    • Check for any available Hotfix - your issue could be already reported/fixed
    • Read documentation - It will be required to Debug and understand Errors for a faster support response

Overriding functions.render.php

Sushii

Chevereto Member
Is there an override feature for functions in functions.render.php? Can you say override a single function rather than the entire file?

Thanks
 
There's not an automated override functionality for those functions, but to make it on your own is easy as include your own custom functions in app/chevereto-hook.php, just make sure to use the same name space.
 
Last edited:
There's not an automated override functionality for those functions, but to make it on your own is easy as include your own custom functions in app/custom-hooks.php, just make sure to use the same name space.

How would I overwrite an existing function or add to it?
 
The app/loader.php loads all the needed core files for all the system's functionality. That said, this loader.php file allows you to add custom hooks which is actually any code you want to add:

upload_2016-8-16_22-16-39.png

So is easy as create an app/chevereto-hook.php file to add new functions in the CHV namespace. It can be also the CHV\Render namespace or even G\ namespace. Sadly in PHP you can't override functions so the only workaround is to stop G\ from load default app functions and use your own.
 
The app/loader.php loads all the needed core files for all the system's functionality. That said, this loader.php file allows you to add custom hooks which is actually any code you want to add:

View attachment 1011

So is easy as create an app/chevereto-hook.php file to add new functions in the CHV namespace. It can be also the CHV\Render namespace or even G\ namespace. Sadly in PHP you can't override functions so the only workaround is to stop G\ from load default app functions and use your own.

Maybe in the future we can do a check to see if existing functions exist in chevereto-hook.php and load that instead. Like how wordpress does it.

e.g. wraping all functions inside a "if(!function_exists(function_name)"
 
Back
Top