PAD Showcase
All tags/Copy

A snippet as content

The pair form - the content is rendered first, so a value of the page goes into the text that is copied.

1 The data copy/config_snippet.php php
<?php

  $app = 'shop';

?>
2 The template copy/config_snippet.pad pad
<div style="width:100%; max-width:640px">
  <p>Put this in <code>apps/{$app}/.env</code>:</p>
  {copy label='Copy settings'}
  padSqlDriver=sqlite
  padSqlDatabase={$app}/{$app}.sqlite
  padSqlSetup=_install/schema.sql
  {/copy}
</div>
3 The result rendered on the server

Put this in apps/shop/.env:

padSqlDriver=sqlite
padSqlDatabase=shop/shop.sqlite
padSqlSetup=_install/schema.sql