Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Multiple Paragraphs in Single Text Submssion #75

Closed
darkstar4386 opened this issue Apr 22, 2016 · 1 comment
Closed

Multiple Paragraphs in Single Text Submssion #75

darkstar4386 opened this issue Apr 22, 2016 · 1 comment

Comments

@darkstar4386
Copy link

This may be a complete noob question, so forgive me if this is the wrong place to ask. Because our content is coming from a database, the paragraphs are in a single field. For a single paragraph this works great:

        ->addChild(
            Paragraph::create()
                ->appendText($content)
        )

But is there an emelent that will allow multiple paragraphs? I can explode the field into an array but I have no idea how to iterate through to create a Paragraph element for each (foreach loops do not work in the element creation code).

@darkstar4386
Copy link
Author

I figured it out. I performed a foreach loop outside the object declaration and added each paragraph as a child to the object.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant