public function actionWeb_version($campaign_uid, $subscriber_uid = null)
{
[...]
$myContent = '<div id="share-widgets">lots of html</div>';
// parse the html
if (!CommonHelper::functionExists('qp')) {
require_once(Yii::getPathOfAlias('common.vendors.QueryPath.src.QueryPath') . '/QueryPath.php');
}
$query = qp($emailContent, 'body', array(
'ignore_parser_warnings' => true,
'convert_to_encoding' => Yii::app()->charset,
'convert_from_encoding' => Yii::app()->charset,
'use_parser' => 'html',
));
// http://api.querypath.org/docs/class_query_path.html#a01c2fc8e3d0725854fcd01f3c5972a5f
$query->prepend($myContent);
$emailContent = $query->top()->html();
echo $emailContent;
}