Sha256: 173345bb8ed7e98b977b53513fcd279482126503c2dc3122c5cf6adcaea53d67

Contents?: true

Size: 988 Bytes

Versions: 10

Compression:

Stored size: 988 Bytes

Contents

--FILE--
<?php
$env = new MtHaml\Environment('php', array('enable_escaper' => false, 'mthaml_variable' => '$mthaml'));
echo $env->compileString($parts['HAML'], "$file.haml");

--HAML--
#php
  :php
    echo $a;
  :php
    foreach (array(#{var_export(foo, true)}) as $item) {
    }
#twig
  :twig
    {{ foo|filter }}
    {% for i in 1..5 %}
        {{ "- \#{i}" }}
    {% endfor %}
  :twig
    {{ #{$foo}|filter }}
--EXPECT--
<div id="php">
  <?php
    echo $a;
  ?>
  <?php echo MtHaml\Runtime::filter($mthaml, 'php', get_defined_vars(),
    ('foreach (array(' . (var_export(foo, true)) . ') as $item) {'). "\n" .
    '}'. "\n"
  ) ?>
</div>
<div id="twig">
  <?php echo MtHaml\Runtime::filter($mthaml, 'twig', get_defined_vars(),
    '{{ foo|filter }}'. "\n" .
    '{% for i in 1..5 %}'. "\n" .
    '    {{ "- #{i}" }}'. "\n" .
    '{% endfor %}'. "\n"
  ) ?>
  <?php echo MtHaml\Runtime::filter($mthaml, 'twig', get_defined_vars(),
    ('{{ ' . $foo . '|filter }}'). "\n"
  ) ?>
</div>

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
guard-mthaml-0.4.0 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_filters.test
guard-mthaml-0.3.1 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_filters.test
guard-mthaml-0.3.0 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_filters.test
guard-mthaml-0.2.5 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_filters.test
guard-mthaml-0.2.4 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_filters.test
guard-mthaml-0.2.3 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_filters.test
guard-mthaml-0.2.2 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_filters.test
guard-mthaml-0.2.1 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_filters.test
guard-mthaml-0.2.0 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_filters.test
guard-mthaml-0.1.0 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_filters.test