require_once '/path/to/vendor/autoload.php';
$loader = new Twig_Loader_Filesystem('/path/to/templates');
$twig = new Twig_Environment($loader, array(
'cache' => '/path/to/compilation_cache',
));
<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{constant('APP_CSRF_TOKEN')}}">
<title>{{constant('APP_TITLE')}}</title>
<!-- Fonts -->
<!-- Styles -->
<link rel="stylesheet" href="{{constant('APP_HOST')}}/styles/main.css">
</head>
<body class="app header-fixed sidebar-fixed aside-menu-fixed aside-menu-hidden">
<header class="app-header navbar">
<div class="container-fluid">
{% block header %}{% endblock %}
</div>
</header>
<div class="app-body">
<!-- Main content -->
<main class="main">
<div class="container-fluid">
{% block content %}{% endblock %}
</div>
<!-- /.container-fluid -->
</main>
</div>
<footer class="app-footer">
<div class="container-fluid">
{% block footer %}{% endblock %}
</div>
</footer>
<script src="{{constant('APP_HOST')}}/scripts/main.js"></script>
</body>
</html>
$unit_tag = $data['_wpcf7_unit_tag'];
if (!preg_match('/^wpcf7-f(\\d+)-p(\\d+)-o(\\d+)$/', $unit_tag, $matches)) {
return false;
}
$post_id = (int) $matches[2];