There isn't a 'preferred' way, or built in function, to render an array of paragraphs. You could do it like this:
$build = array(
'p1' => array(
'#markup' => 'Something',
'#prefix' => '<p>',
'#suffix' => '</p>',
),
'p2' => array(
'#markup' => 'Something else',
'#prefix' => '<p>',
'#suffix' => '</p>',
),
);
Or this:
$build = array(
'p1' => array(
'#markup' => '<p>Something</p>',
),
'p2' => array(
'#markup' => '<p>Something else</p>',
),
);
Or you could build a theme function which takes an array of paragraphs and builds up an HTML string. Or you could use some variation of implode()
, or a simple loop, and so on.
It really depends on how you want to approach it, there are several equally valid ways to solve that problem.