Is this good way to prerender with PHP?


Hello friends,

I am using PHP Symfony framework and I want some components to be handled with vue.

Is this example correct way to prerender content with PHP (its just fast example :])

Thank you very much

<!doctype html>
<html class="no-js" lang="">
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        body {
            background: #20262E;
            padding: 20px;
            font-family: Helvetica;
        #boxes {
            background: #fff;
            border-radius: 4px;
            padding: 20px;
            transition: all 0.2s;
        section {
            width: 100%;
            display: flex;
            flex-direction: row;
            justify-content: space-between;
        .abc {
            margin: 8px 0;
            display: block;
            padding: 20px;
            border: 1px solid black;
        h2 {
            font-weight: bold;
            margin-bottom: 15px;
        $boxes = [
            ["text" => "Learn JavaScript"],
            ["text" => "Learn Vue"],
            ["text" => "Play around in JSFiddle"],
            ["text" => "Build something awesome"],
    <div id="boxes">
            foreach ($boxes as $key => $box) {
                echo '<box text="'.$box['text'].'"><div class="abc"><span>'.$box['text'].'</span></div></box>';
    <script src=""></script>
        Vue.component('box', {
            data: function () {
                return {
                    text: ""
            props: ['text'],
            template: '<div class="abc"><span v-text="text"></span></div>'
        new Vue({ el: "#boxes" })


maybe it is not a good idea…