Calling Developers!
We are reenergizing our code contribution process! Learn More

What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hello, the hands-on section "Define and Use a Config Value" of the lesson "Project Customization" co

Options
U04V0L4ATAQ
U04V0L4ATAQ Posts: 11 🧑🏻‍🚀 - Cadet

Hello, the hands-on section "Define and Use a Config Value" of the lesson "Project Customization" could use a lot more hints.

Tagged:

Comments

  • Hari Vijayakumar
    Hari Vijayakumar Sprykee Posts: 27 🏛 - Council (mod)
    Options

    Hi Simon, thank you for the feedback! Will pass this along to our team! 🙂

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,016 ⚖️ - Guardians (admin)
    Options

    Hey, what additional hints would have helped you to solve this challenge better?

  • U04V0L4ATAQ
    U04V0L4ATAQ Posts: 11 🧑🏻‍🚀 - Cadet
    edited April 2023
    Options

    I might be able to answer that, if I saw the finished answer. Oh, that's what they wanted us to do, now I see.

    I have the backoffice HelloWorld example done, as well as the Yves Training stuff involved with the Antelope (Persist, Fetch...).

    I've added a config value to config\Shared\config_default.php: $config['training-test-constant'] = 123;

    I've added Pyz\Zed\Training\TrainingConfig.php:

    ...
    class TrainingConfig extends AbstractBundleConfig
    {
      public function getTrainingTestConstant()
      {
        return $this->get('training-test-constant');
      }
    }
    

    I've added Pyz\Zed\Training\TrainingCommunicationFactory.php:

    ...
    class TrainingCommunicationFactory extends AbstractCommunicationFactory
    {
      // is this supposed to be left empty?
    }
    

    I'm guessing the end result would print my test constant 123 in the backoffice HelloWorld example, not in the Yves Training Antelope example. But I'm confused as to how to use the Training module from the HelloWorld indexController. Create a Training object?

    How important are those magic method annotations?

    /**
     * @method \Pyz\Zed\Training\TrainingConfig getConfig()
     */
    
  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,016 ⚖️ - Guardians (admin)
    Options

    yes, you are just missing one step: use your config value in the HelloController

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,016 ⚖️ - Guardians (admin)
    Options

    But thank you for your feedback - it seems that this is not 100% clear so we will need to adjust

  • Hari Vijayakumar
    Hari Vijayakumar Sprykee Posts: 27 🏛 - Council (mod)
    Options
  • U04V0L4ATAQ
    U04V0L4ATAQ Posts: 11 🧑🏻‍🚀 - Cadet
    Options

    Guess the confusion comes from the task asking us to show a config value in the backoffice HelloWorld example, but we are writing classes to the "Persist, Fetch..." lesson's Training folder.