Skip to content

Commit

Permalink
Merge pull request #34 from coldbox-modules/patch/Add-Docs-for-Aliasing
Browse files Browse the repository at this point in the history
Add docs for aliasing
  • Loading branch information
lmajano authored Mar 17, 2023
2 parents 9f49fb1 + 433415e commit e300a4a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,18 @@ string function getAvatarLink( numeric size=40 ){
return variables.avatar.generateLink( getEmail(), arguments.size );
}
```
##### Includes Aliasing

You may also wish to alias properties or getters in your components to a different name in the generated memento. You may do this by using a colon with the left hand side as the name of the property or getter ( without the `get` ) and the right hand side as the alias. For example let's say we had a getter of `getLastLoginTime` but we wanted to reference it as `lastLogin` in the memento. We can do this with aliasing.

```js
defaultIncludes = [
"firstName",
"lastName",
"avatarLink",
"lastLoginTime:lastLogin"
]
```

##### Nested Includes

Expand Down

0 comments on commit e300a4a

Please sign in to comment.