Browse Source
Merge pull request #17400 from abpframework/LayoutHookViewComponent
Get hooks by current layout.
pull/17403/head
Engincan VESKE
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
3 deletions
-
framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs
|
|
|
@ -18,9 +18,9 @@ public class LayoutHookViewComponent : AbpViewComponent |
|
|
|
|
|
|
|
public virtual IViewComponentResult Invoke(string name, string layout) |
|
|
|
{ |
|
|
|
var hooks = Options.Hooks.GetOrDefault(name)?.Where(IsViewComponent).ToArray() |
|
|
|
?? Array.Empty<LayoutHookInfo>(); |
|
|
|
|
|
|
|
var hooks = Options.Hooks.GetOrDefault(name)?.Where(x => x.Layout == layout && IsViewComponent(x)).ToArray() |
|
|
|
?? Array.Empty<LayoutHookInfo>(); |
|
|
|
|
|
|
|
return View( |
|
|
|
"~/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/Default.cshtml", |
|
|
|
new LayoutHookViewModel(hooks, layout) |
|
|
|
|