PHP code example of programmatordev / kinky

1. Go to this page and download the library: Download programmatordev/kinky library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

programmatordev / kinky example snippets


kinky()->transformTemplate(string $template, array $data = []): string

// templates/default.php

// template will be located at /site/templates/emails/notification.html.php
<?= kinky()->transformTemplate('notification', [
    'name' => 'Kinky',
    'text' => 'Oh là là'
]); 

use Kirby\Email\Email;

kinky()->email(mixed $preset = [], array $props = []): Email

// note that the "template" property is ification', // com',
    'subject' => 'Kinky Plugin',
    'data' => [
        'name' => 'Kinky',
        'text' => 'Oh là là'
    ]
]);

kirby()->email([
    'from' => '[email protected]',
    'to' => '[email protected]',
    'subject' => 'Kinky Plugin',
    'body' => [
        'html' => kinky()->transformTemplate('notification', [
            'name' => 'Kinky',
            'text' => 'Oh là là'
        ])
    ]
]);
html
<!-- templates/emails/email.html.php -->

<wrapper class="body">
    <container>
        <row>
            <columns>Kinky</columns>
            <columns>Oh là là</columns>
        </row>
    </container>
</wrapper>