It's incredibly simple

Getting Started

Follow the instructions below to see how easy it is to get started with Dytomate. It's as easy as downloading 1 file and providing a couple of configuration options.

Download For Free

Enabling The Power Of Dytomate

Getting started with Dytomate is incredibly easy. First create a MySQL database where all data will be stored.

CREATE DATABASE `dytomate`;

Then download this .zip file, extract it and provide your configuration options including details to connect to the database you just created. Lastly create an uploads directory and make it writable. chmod 777 uploads should do the trick. Now you're ready to go!


<?php
require "dytomate.php";

\SDS\Dytomate\DytomateFactory::setDefaultConfiguration([
    "pdo" => [
        "dsn" => "mysql:host=localhost;port=3306;dbname=dytomate", // database connection string
        "user" => "root", // database username
        "password" => "secret" // database password
    ],
    "http" => [
        "basePath" => "/" // base URL for your website
    ],
    "uploadPath" => __DIR__ . "/uploads", // directory where uploaded images will be stored
    "uploadUrl" => "/uploads", // publicly accessible path to uploaded images
    "isAccessAllowedCallback" => function() { // callback that handles access to Dytomate
        return true;
    },
    "defaultData" => [ // your initial data
        "site-title" => "This is my default site title."
    ]
]);

$dytomate = \SDS\Dytomate\DytomateFactory::makeDefault();

if ($dytomate->getRouter()->route()) { // handle Dytomate routes to allow saving data
    exit; // don't show website if Dytomate route was handled
}
?>
<!DOCTYPE html>
<html>
    <head>
        <title>Dytomate Example</title>
        <script src="http://dytomate.com/cdn/dytomate.min.js"></script>
    </head>

    <body>
        <!-- This is how you render editable elements. Initial contents of this element will be taken from `defaultData` section above. -->
        <?= $dytomate->getTag("title", "h1", [ "class" => "site-title" ]) ?>

        <!-- You can also provide default data in the same method call. -->
        <?= $dytomate->getTag("description", "p", [ "class" => "site-description" ], "And this is my default description.") ?>

        <!-- Use it for images as well. This will even provide a 300x300px image for you as the initial image. -->
        <?= $dytomate->getTag("logo", "img", [ "class" => "site-logo" ], 300) ?>
    </body>
</html>
        

That's it! Now you know all the basics. If you want to learn more please read our documentation.

Do you like magic? We sure do! Subscribe for monthly tips on techology fairy dust you can show your clients when delivering a web application.
i