Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Developer Documentation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JKingsnorth
Developer Documentation
Commits
b7d22471
Commit
b7d22471
authored
2 years ago
by
colemanw
Browse files
Options
Downloads
Patches
Plain Diff
Add example for embedding Afform
parent
52f4cf87
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/afform/overview.md
+22
-1
22 additions, 1 deletion
docs/afform/overview.md
with
22 additions
and
1 deletion
docs/afform/overview.md
+
22
−
1
View file @
b7d22471
...
...
@@ -10,9 +10,30 @@ automatically appear on the dashboard or contact summary screen. Afforms can be
other Afforms simply by including the directive for one Afform in the markup of another; Angular
dependencies will be resolved automatically.
### Embedding in Smarty Templates
*Adding Afforms to traditional Smarty-based pages or forms can be a transitional step away from legacy screens*
**PHP Code**
```
php
Civi
::
service
(
'angularjs.loader'
)
->
addModules
(
'afformMyForm'
);
$this
->
assign
(
'myAfformVars'
,
$optionalVars
);
```
**Template Code**
```
<crm-angular-js modules="afformMyForm">
<form id="bootstrap-theme">
<afform-my-form options='{$myAfformVars|@json_encode}'></afform-my-form>
</form>
</crm-angular-js>
```
## Afform Types
-
**form**
: A form which submits through the
`Afform::submit`
api, editable in the form-builder GUI.
-
**block**
: A snippet meant to be incorporated into a larger form.
-
**system**
(default): Non-editable forms.
-
**search**
: An afform with an embedded
[
SearchKit Display
](
../searchkit/displays.md
)
and optional search filter fields.
\ No newline at end of file
-
**search**
: An afform with an embedded
[
SearchKit Display
](
../searchkit/displays.md
)
and optional search filter fields.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment