Skip to content

Instantly share code, notes, and snippets.

@boboldehampsink
Last active August 29, 2015 14:13
Show Gist options
  • Save boboldehampsink/dad25ab5b6cd8c6d7376 to your computer and use it in GitHub Desktop.
Save boboldehampsink/dad25ab5b6cd8c6d7376 to your computer and use it in GitHub Desktop.
New Entry model with field layout in Craft
<html>
<body>
{% set user = craft.sample.newUserModel() %}
{{ user.memberNumber }}
</body>
</html>
<?php
namespace Craft;
class SampleVariable
{
public function newUserModel()
{
// Create a new empty user model
$user = new UserModel();
// Return model
return $user;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment