1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

How to add content to custom form type

Discussion in 'Development' started by byyEmirhanWSD, Feb 21, 2018.

  1. byyEmirhanWSD

    byyEmirhanWSD Witch

    Messages:
    50
    GitHub:
    EmirhanWSD
    Function :
    PHP:
    Custom Form :
    $form->addContent();
    Simple Form :
    $form->setContent("Text");
    How to fill addContent function?
     
  2. armagadon159753

    armagadon159753 Zombie

    Messages:
    217
    GitHub:
    armagadon159753
  3. byyEmirhanWSD

    byyEmirhanWSD Witch

    Messages:
    50
    GitHub:
    EmirhanWSD
    PHP:
    $f->addContent(array("Text"));
    // ???
     
  4. kenygamer

    kenygamer Banned Banned

    Messages:
    106
    GitHub:
    kenygamer
    array()? Prefer [] over array().
     
  5. byyEmirhanWSD

    byyEmirhanWSD Witch

    Messages:
    50
    GitHub:
    EmirhanWSD
    PHP:
    $f->addContent(array["Text"]);
    // ?
     
  6. FlatterGnat9702

    FlatterGnat9702 Spider

    Messages:
    14
    GitHub:
    FlatterGnat9702
    Try it.
    PHP:
    addContent(["content" => "text"]);
     
  7. byyEmirhanWSD

    byyEmirhanWSD Witch

    Messages:
    50
    GitHub:
    EmirhanWSD
    Thanks. Example :D
    PHP:
    $f->addContent(["content" => "Hi forum!"]);
     
  8. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
  9. FlatterGnat9702

    FlatterGnat9702 Spider

    Messages:
    14
    GitHub:
    FlatterGnat9702
    And this is definitely not a crutch? :shoghi:
     
  10. byyEmirhanWSD

    byyEmirhanWSD Witch

    Messages:
    50
    GitHub:
    EmirhanWSD
    Hmm, this is simple.
    PHP:
    $f->addLabel("Text");
    // ?
     
  11. FlatterGnat9702

    FlatterGnat9702 Spider

    Messages:
    14
    GitHub:
    FlatterGnat9702
    You are silly? Take it and check it, and do not ask questions for each line.
     
  12. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    It is just people's own code style preference. There is no advantage of [] over array().
     
  13. AshBull

    AshBull Spider Jockey

    Messages:
    31
    addContent() is an internal method used by forms, not for adding text. Use addLabel() as stated above.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.