1

When I kint:

{{ kint(elements.steps[0].step.description['#object']) }}

I get:

...
[activities:protected] => Array
    (
       (
        [17] => stdClass Object
            (
                [__CLASS__] => stdClass
                [id] => 17
                [vid] => 17
                [type] => opigno_video
                [name] => Dzień 1
                [usage_activity] => local
                [skills_list] => 
                [skill_level] => 
                [activity_status] => 1
                [weight] => -1000
                [max_score] => 10
                [auto_update_max_score] => 0
                [omr_id] => 25
                [omr_pid] => 
                [child_id] => 17
                [child_vid] => 17
            )
...

I would like to get all these activities, can I get them inside twig file? I tried:

{{ kint(elements.steps[0].step.description['#object']->get('activities') }}
{{ kint(elements.steps[0].step.description['#object']->activities) }}

And some other options, but no result so far.

2
  • What's this step? What's this template? Sometimes easier to preprocess it into the template.
    – leymannx
    Jan 24, 2022 at 17:57
  • 2
    it´s a protected property, so you can only access this if there´s a public method in that class that returns the activities, pls find out which typeof #object is and check the source for methods
    – john Smith
    Jan 24, 2022 at 20:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.