Data from renderComponent accessible by rendered component's functions.php #399
-
Hi, I've got a component that uses Timber::get_posts() to query a custom post type. The component loops through all the posts, like this:
So I'm passing the ID of the post to the PartialComponentCard component, each time i loop through the posts. In the rendered component's .twig file, I can easily access/manipulate the componentID variable. Is there a way for the rendered component's functions.php file to have access to the componentID data so that I can use it to run custom php functions to get various points of data across the site using that componentID? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
So I guess ignore this question...I hadn't even thought to just output $data inside my component's functions.php file, because that houses all the data that was sent via the renderComponent.
|
Beta Was this translation helpful? Give feedback.
So I guess ignore this question...I hadn't even thought to just output $data inside my component's functions.php file, because that houses all the data that was sent via the renderComponent.