Been trying to go bout how to accomplish dividing content on view output.
I'm loading records from Mysql, inserting values into HEREDOC to then output to view.
I want to display only a certain amount of characters in a particular row within the HEREDOC, hide the rest from view on DOM.
I tried using a function like this within the HEREDOC to insert a "More" link after certain amount of characters.
I've tried a couple methods:
1
<<<EOT
<div id="$id_op">
{substr_replace($contents, "More", 400)}
</div>
EOT;
2
<<<EOT
<div id="$id_op">
{${substr_replace($contents, "More", 400)}}
</div>
EOT;
There might be other better methods to accomplish this. For now I want to load the record completely into dom but hide part of it until user have clicked a jQuery selector.
Any help / direction will be truly appreciated.