Skip to content

Adding custom parameters to code blocks

Home Support Support Tickets Adding custom parameters to code blocks

Viewing 1 reply thread
  • Author
    Posts
    • #15258

      Hello,

      I was trying to add custom parameters to using the following code in a php block:
      $cb->params()->add(‘theme’, ‘string’, ‘darkness’)->validate();

      but this seems to cause the script to error out when it is executed.

      Is this the proper way to add custom parameters or is there another way to specify what parameters the code block accepts?

    • #15600

      Hi there,

      Thanks for your question!

      The code you provided is almost correct, but it seems there might be an issue with the syntax or method being used. To better assist you, could you let me know what error message you’re seeing when the script runs?

      In the meantime, please ensure that the $cb object is correctly initialized and that the params() method is being called on the right object. If you can provide more details about your setup or the specific use case for these parameters, I can guide you more accurately.

      Looking forward to your response!

Viewing 1 reply thread
  • You must be logged in to reply to this topic.