• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.
  • 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