Skip to content

Instantly share code, notes, and snippets.

@dandelauro
Created January 21, 2016 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dandelauro/0114717244d6a4f9fa8f to your computer and use it in GitHub Desktop.
Save dandelauro/0114717244d6a4f9fa8f to your computer and use it in GitHub Desktop.
A sample "Home" controller using Twig and Mustache PHP templating.
<?php
namespace App\Http\Controllers;
class HomeController extends Controller
{
public function show()
{
$dataJsonAsPhpArray = array(
“title” => “This is my title.”,
“subTitle” => “There are many like it, but this one is mine.”,
“description” => “My title is my best friend. It is my life. I must master it as I must master my life.”
)
return view('home', array(
"title" => "Pattern Lab",
"htmlClass" => "pl",
"bodyClass" => "body",
"allOfThePatterns" => view('PatternLab::04-pages.01-home', $dataJsonAsPhpArray)
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment