Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I store HTML in a Doctrine YML fixture
    primarykey
    data
    text
    <p>I am working with a CMS-type site in Symfony 1.4 (Doctrine 1.2) and one of the things that is frustrating me is not being able to store HTML pages in YML fixtures. Instead I have to create SQL backups of the data if I want to drop and rebuild which is a bit of a pest when Symfony/Doctrine has a fantastic mechanism for doing exactly this.</p> <p>I could write a mechanism that reads in a set of HTML files for each page and fills the data in that way (or even write it as a task). But before I go down that road I am wondering if there is any way for HTML to be stored in a YML fixture so that Doctrine can simply import it into the database.</p> <p><strong>Update:</strong></p> <p>I have tried using <code>symfony doctrine:data-dump</code> and <code>symfony doctrine:data-load</code> however despite the dump correctly creating the fixture with the HTML, the load task appears to 'skip' the value of the column with the HTML and enters everything else into the row. In the database the field doesn't show up as 'NULL' but rather empty so I believe Doctrine is adding the value of the column as ''.</p> <p>Below is a sample of the YML fixture that <code>symfony doctrine:data-dump</code> created. I have tried running <code>symfony doctrine:data-load</code> against various forms of this including removing all the escaped characters (new lines and quotes leaving only angle brackets) but it still doesn't work.</p> <pre><code> Product_69: name: 'My Product' Developer: Developer_30 tagline: 'Text that briefly describes the product' version: '2008' first_published: '' price_code: A79 summary: '' box_image: '' description: "&lt;div id=\"featureSlider\"&gt;\n &lt;ul class=\"slider\"&gt;\n &lt;li class=\"sliderItem\" title=\"Summary\"&gt;\n &lt;div class=\"feature\"&gt;\n Some text goes in here&lt;/div&gt;\n &lt;/li&gt;\n &lt;/ul&gt;\n &lt;/div&gt;\n" is_visible: true </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload