• 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

Need some help about G framework

cedricju

Chevereto Member
Hello,

do you have more documentation about variable send to view ?
for exemple in app/theme/themename/views/user.php all variable are get with : get_user()['variable_name']
how can get variable from another class ? is it working with files name :
view : user.php
class : class.user.php

how can send album ID with get_album()[my_variable] from another view ?
is it the fill() class function that populate variable to view ?

I just begin to write a new theme to in future add plugins that override core with decorator. Do you any adverting about it with your framework ?
Do you have any peace of code about it ?

Thanks
 
In Chevereto route.image.php binds get_image() and several other stuff, is made in such way that to get the user who owns that image you use get_image()['user'] and if you want the album you use get_image()['album']. The whole get_image() is made in this way to avoid any extra query.

So if you are into /album you use get_album()['user'] to get the user who owns that album. Basically all this thing works in context, no extra hit on the database.

In the event that you actually need to access other methods, call the database or anything, you can cast any method using the right context, in themes you should use CHV\Album::getSingle($args) to get a target album, you can also use CHV\Login::getUser(), etc. Actually you can cast all the public methods. There is a huge list of things that you can do, just dig the classes dir.

Regarding fill(); it is a special method present in some classes. The thing that it does is that takes the database record and injects more data to the array. For example, it injects the id_encoded props because that is not stored directly in the dabatase. The job of the fill() method is to prepare the array to contain all that the system needs.

I know that it could be complicated and G\ and Chevereto are actually still work in progress regarding code structure, in other words, I'm using a lot of experimental stuff in this.
 
Last edited:
Back
Top