Last active
August 29, 2015 14:13
-
-
Save boboldehampsink/dad25ab5b6cd8c6d7376 to your computer and use it in GitHub Desktop.
New Entry model with field layout in Craft
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
{% set user = craft.sample.newUserModel() %} | |
{{ user.memberNumber }} | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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