Skip to content

Commit

Permalink
Add more links
Browse files Browse the repository at this point in the history
  • Loading branch information
cllns committed Nov 23, 2024
1 parent 9041e48 commit fc3ee57
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ $ gem install hanami-view
- [Context](#context)
- [Testing](#testing)


### Introduction

Use hanami-view if:
Expand Down Expand Up @@ -212,7 +213,7 @@ Some configuration-related options can also be passed at render-time, to `Hanami


### Injecting dependencies

###### ⬆️ Back to [Table of contents](#table-of-contents)

Most views will need access to other parts of your application to prepare values for the view. Since views follow the "functional object" pattern (local state for config and collaborators only, with any variable data passed to `#call`), it’s easy to use dependency injection to make your application’s objects available to your views.

Expand Down Expand Up @@ -248,7 +249,9 @@ class MyView < Hanami::View
end
```


### Exposures
###### ⬆️ Back to [Table of contents](#table-of-contents)

Define _exposures_ within your view to declare and prepare the values to be passed to the template, decorated as [parts](#parts).

Expand Down Expand Up @@ -410,7 +413,9 @@ You can create an exposure whose value is not decorated by a part. This may be h
expose :page_number, decorate: false
```


### Templates
###### ⬆️ Back to [Table of contents](#table-of-contents)

Every view has a template, which is passed the values from the view’s [exposures](#exposures) and then used to render the view output.

Expand Down Expand Up @@ -508,8 +513,9 @@ Otherwise, partials accept keywords arguments, which become the partial’s loca

The view’s context object remains part of the scope for every partial rendering, regardless of the arguments passed.

### Parts

### Parts
###### ⬆️ Back to [Table of contents](#table-of-contents)

All values [exposed](#exposures) by your view are decorated and passed to your templates as _parts_, which allow encapsulation of view-specific behavior alongside your application's domain objects.

Expand Down Expand Up @@ -714,7 +720,9 @@ Your part builder must conform to the following interface:

You can also inherit from `Hanami::View::PartBuilder` and override any of its methods, if you want to customize just a particular aspect of the standard behavior.


### Scopes
###### ⬆️ Back to [Table of contents](#table-of-contents)

All values [exposed](#exposures) by your view are decorated and passed to your templates as _parts_, which allow encapsulation of view-specific behavior alongside your application's domain objects.

Expand Down Expand Up @@ -921,6 +929,7 @@ You can also inherit from `Hanami::View::PartBuilder` and override any of its me


### Context
###### ⬆️ Back to [Table of contents](#table-of-contents)

Use a context object to provide shared facilities to every template, partial, scope, and part in a given view rendering.

Expand Down Expand Up @@ -1023,7 +1032,7 @@ end


### Context

###### ⬆️ Back to [Table of contents](#table-of-contents)

Use a context object to provide shared facilities to every template, partial, scope, and part in a given view rendering.

Expand Down Expand Up @@ -1125,6 +1134,7 @@ end
```

### Testing
###### ⬆️ Back to [Table of contents](#table-of-contents)

Use a context object to provide shared facilities to every template, partial, scope, and part in a given view rendering.

Expand Down

0 comments on commit fc3ee57

Please sign in to comment.