🎨
Latte Templates
Leverage the elegant and powerful Latte templating engine with .latte files in your CakePHP applications
📄 layout.latte
<!DOCTYPE html>
<html>
<head>
{Html charset}
<title>{block title}Homepage{/block} - My app</title>
{* $this->Html->css('site') *}
{Html css 'site'}
{Html js 'app'}
{* $this->fetch('meta') *}
{fetch meta}
{fetch css}
{fetch script}
</head>
<body>
<header>
<h1>{block title}Latte + CakePHP = Awesome{/block}</h1>
</header>
<main>
{include content}
</main>
<footer>
{block footer}
Copyright {$today|format:'Y'}
{/block}
</footer>
</body>
</html>
📄 add.latte
{block title}Create article{/block}
{block content}
{* $this->Form->create($user) *}
<form n:context="$user">
<control n:name="first_name" />
<control n:name="last_name" />
<control n:name="email" />
<control n:name="password" />
<control n:name="bio" rows="10" />
<button type="submit">{_'Save article'}</button>
<a n:named="users:index">{_'Go back'}</a>
</form>