From 3b5c642b67a4b52f263324ab77c529c7e3ad7383 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 15:39:03 +0000 Subject: [PATCH] deploy: 7c2f3b7738fc3655a8be9c35acd1f93a5ad666c3 --- 404.html | 2 +- assets/js/11e5ea2c.3c2035e9.js | 1 - assets/js/11e5ea2c.ad314188.js | 1 + assets/js/4fbd1f13.8ccdde38.js | 1 + assets/js/4fbd1f13.fe815f46.js | 1 - assets/js/6505ded5.02bc1508.js | 1 - assets/js/6505ded5.d3a12ce9.js | 1 + assets/js/891b7c56.05843359.js | 1 - assets/js/891b7c56.8125229f.js | 1 + assets/js/907b9470.bb12813f.js | 1 + assets/js/907b9470.d86dd096.js | 1 - assets/js/e0a19902.8552b682.js | 1 + assets/js/e0a19902.f1220568.js | 1 - ...n.1f129c02.js => runtime~main.6793121d.js} | 2 +- blog.html | 2 +- blog/archive.html | 2 +- blog/authors.html | 2 +- blog/new-documentation.html | 2 +- blog/tags.html | 2 +- blog/tags/admin.html | 2 +- blog/tags/laminas.html | 2 +- blog/tags/lm-commons.html | 2 +- blog/tags/lmc-admin.html | 2 +- blog/tags/php.html | 2 +- docs/Authorization.html | 2 +- docs/Introduction.html | 2 +- docs/Navigation.html | 2 +- docs/Routes.html | 2 +- docs/ViewLayout.html | 2 +- docs/next/Authorization.html | 12 +++---- docs/next/Introduction.html | 8 ++--- docs/next/Navigation.html | 4 +-- docs/next/Routes.html | 16 ++++----- docs/next/Upgrading/to-v2.html | 6 ++-- docs/next/ViewLayout.html | 36 +++++++++---------- index.html | 2 +- markdown-page.html | 2 +- 37 files changed, 66 insertions(+), 66 deletions(-) delete mode 100644 assets/js/11e5ea2c.3c2035e9.js create mode 100644 assets/js/11e5ea2c.ad314188.js create mode 100644 assets/js/4fbd1f13.8ccdde38.js delete mode 100644 assets/js/4fbd1f13.fe815f46.js delete mode 100644 assets/js/6505ded5.02bc1508.js create mode 100644 assets/js/6505ded5.d3a12ce9.js delete mode 100644 assets/js/891b7c56.05843359.js create mode 100644 assets/js/891b7c56.8125229f.js create mode 100644 assets/js/907b9470.bb12813f.js delete mode 100644 assets/js/907b9470.d86dd096.js create mode 100644 assets/js/e0a19902.8552b682.js delete mode 100644 assets/js/e0a19902.f1220568.js rename assets/js/{runtime~main.1f129c02.js => runtime~main.6793121d.js} (82%) diff --git a/404.html b/404.html index 60bee4c..63f1d45 100644 --- a/404.html +++ b/404.html @@ -5,7 +5,7 @@ Page Not Found | LmcAdmin - + diff --git a/assets/js/11e5ea2c.3c2035e9.js b/assets/js/11e5ea2c.3c2035e9.js deleted file mode 100644 index 026fd17..0000000 --- a/assets/js/11e5ea2c.3c2035e9.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[972],{3166:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>d,contentTitle:()=>r,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>s});var t=i(4848),o=i(8453);const a={sidebar_position:5,title:"View & Layout"},r="View and layout scripts",l={id:"ViewLayout",title:"View & Layout",description:"LmcAdmin includes an admin layout and index view script, so LmcAdmin works out of the box. These view scripts are fully",source:"@site/docs/ViewLayout.md",sourceDirName:".",slug:"/ViewLayout",permalink:"/LmcAdmin/docs/next/ViewLayout",draft:!1,unlisted:!1,editUrl:"https://github.com/lm-commons/lmcadmin/tree/master/docs/docs/ViewLayout.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5,title:"View & Layout"},sidebar:"documentationSidebar",previous:{title:"Authorization",permalink:"/LmcAdmin/docs/next/Authorization"},next:{title:"From v1 to v2",permalink:"/LmcAdmin/docs/next/Upgrading/to-v2"}},d={},s=[{value:"Use the applications's default layout",id:"use-the-applicationss-default-layout",level:2},{value:"Override the LmcAdmin layout",id:"override-the-lmcadmin-layout",level:2},{value:"Override the view script for the AdminController index action",id:"override-the-view-script-for-the-admincontroller-index-action",level:2},{value:"Disable layout",id:"disable-layout",level:2}];function c(e){const n={code:"code",em:"em",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",strong:"strong",...(0,o.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"view-and-layout-scripts",children:"View and layout scripts"})}),"\n",(0,t.jsx)(n.p,{children:"LmcAdmin includes an admin layout and index view script, so LmcAdmin works out of the box. These view scripts are fully\ncustomizable, you can turn them off or render other scripts.\nAll options are listed below."}),"\n",(0,t.jsx)(n.h2,{id:"use-the-applicationss-default-layout",children:"Use the applications's default layout"}),"\n",(0,t.jsx)(n.p,{children:"You can disable LmcAdmin from using its own layout via configuration and the application's default layout\nwill be used.\nThe routing and navigation still works, but the applicaiton's default layout script will be used."}),"\n",(0,t.jsx)(n.p,{children:"You can modify the configuration to disable the usage of LmcAdmin layout."}),"\n",(0,t.jsxs)(n.p,{children:["In ",(0,t.jsx)(n.code,{children:"config/autoload/lmcadmin.global.php"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-php",children:"return [\n 'lmc_admin' => [\n 'use_admin_layout' => false\n ],\n];\n"})}),"\n",(0,t.jsx)(n.h2,{id:"override-the-lmcadmin-layout",children:"Override the LmcAdmin layout"}),"\n",(0,t.jsx)(n.p,{children:"You can provide your own admin layout script."}),"\n",(0,t.jsx)(n.p,{children:"First create a layout view script in your application and define the View Manager template map to list\nyour custom layout script. Then modify the LmcAdmin configuration to define the layout that LmcAdmin will use:"}),"\n",(0,t.jsxs)(n.p,{children:["In ",(0,t.jsx)(n.code,{children:"config/autoload/lmcadmin.global.php"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-php",children:"return [\n 'lmc_admin' => [\n 'admin_layout_template' => 'myapp/myadminlayout',\n ],\n];\n"})}),"\n",(0,t.jsx)(n.p,{children:"And in your module config:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-php",children:"return [\n 'view_manager' => [\n 'template_map' => [\n 'myapp/myadminlayout' => '/path/to/your/layout/template/script'\n ],\n ],\n];\n"})}),"\n",(0,t.jsxs)(n.h2,{id:"override-the-view-script-for-the-admincontroller-index-action",children:["Override the view script for the ",(0,t.jsx)(n.code,{children:"AdminController"})," index action"]}),"\n",(0,t.jsxs)(n.p,{children:["You can also define the script rendered when you visit ",(0,t.jsx)(n.code,{children:"/admin"})," which defaults to ",(0,t.jsx)(n.code,{children:"AdminController::indexAction()"})]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"AdminController::indexAction()"})," will return a View Model using the template ",(0,t.jsx)(n.code,{children:"lmc-admin/admin/index"}),"."]}),"\n",(0,t.jsx)(n.p,{children:"Therefore, you can override the template via the View Manager template map."}),"\n",(0,t.jsx)(n.p,{children:"In your module config:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-php",children:"return [\n 'view_manager' => [\n 'template_map' => [\n 'lmc-admin/admin/index' => '/path/to/your/template/script'\n ],\n ],\n];\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Make sure your module is registered in the ",(0,t.jsx)(n.code,{children:"modules.config.php"})," ",(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"after"})})," ",(0,t.jsx)(n.code,{children:"LmcAdmin"})," to override LmcAdmin configuration."]}),"\n",(0,t.jsx)(n.h2,{id:"disable-layout",children:"Disable layout"}),"\n",(0,t.jsx)(n.p,{children:"If you need a page within an admin controller where only the view script is rendered,\nyou can disable the layout.\nLayout disabling works just like any other page outside LmcAdmin where you disable the layout.\nTo accomplish this, you must terminate the view model in your controller:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-php",children:"class MyAdminController extends AbstractActionController\n {\n public function indexAction()\n {\n $model = new ViewModel;\n $model->setTerminal(true);\n return $model;\n }\n}\n"})})]})}function u(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(c,{...e})}):c(e)}},8453:(e,n,i)=>{i.d(n,{R:()=>r,x:()=>l});var t=i(6540);const o={},a=t.createContext(o);function r(e){const n=t.useContext(a);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),t.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/11e5ea2c.ad314188.js b/assets/js/11e5ea2c.ad314188.js new file mode 100644 index 0000000..1b99bb2 --- /dev/null +++ b/assets/js/11e5ea2c.ad314188.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[972],{3166:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>r,contentTitle:()=>l,default:()=>m,frontMatter:()=>o,metadata:()=>d,toc:()=>s});var i=t(4848),a=t(8453);const o={sidebar_position:5,title:"Views & Layouts"},l="View and layout templates",d={id:"ViewLayout",title:"Views & Layouts",description:"LmcAdmin includes an admin layout template and an index view template, such that LmcAdmin works out of the box. These view templates are fully",source:"@site/docs/ViewLayout.md",sourceDirName:".",slug:"/ViewLayout",permalink:"/LmcAdmin/docs/next/ViewLayout",draft:!1,unlisted:!1,editUrl:"https://github.com/lm-commons/lmcadmin/tree/master/docs/docs/ViewLayout.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5,title:"Views & Layouts"},sidebar:"documentationSidebar",previous:{title:"Authorization",permalink:"/LmcAdmin/docs/next/Authorization"},next:{title:"From v1 to v2",permalink:"/LmcAdmin/docs/next/Upgrading/to-v2"}},r={},s=[{value:"Use the applications's default layout template",id:"use-the-applicationss-default-layout-template",level:2},{value:"Override the LmcAdmin layout template",id:"override-the-lmcadmin-layout-template",level:2},{value:"Override the view template for the AdminController index action",id:"override-the-view-template-for-the-admincontroller-index-action",level:2},{value:"Disable layout",id:"disable-layout",level:2}];function c(e){const n={code:"code",em:"em",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",strong:"strong",...(0,a.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"view-and-layout-templates",children:"View and layout templates"})}),"\n",(0,i.jsx)(n.p,{children:"LmcAdmin includes an admin layout template and an index view template, such that LmcAdmin works out of the box. These view templates are fully\ncustomizable, you can turn them off or render other templates.\nAll options are listed below."}),"\n",(0,i.jsx)(n.h2,{id:"use-the-applicationss-default-layout-template",children:"Use the applications's default layout template"}),"\n",(0,i.jsx)(n.p,{children:"You can disable LmcAdmin from using its own layout via configuration and the application's default layout\nwill be used.\nThe routing and navigation still works, but the application's default layout template will be used."}),"\n",(0,i.jsx)(n.p,{children:"You can modify the configuration to disable the usage of LmcAdmin layout."}),"\n",(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"config/autoload/lmcadmin.global.php"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-php",children:"return [\n 'lmc_admin' => [\n 'use_admin_layout' => false\n ],\n];\n"})}),"\n",(0,i.jsx)(n.h2,{id:"override-the-lmcadmin-layout-template",children:"Override the LmcAdmin layout template"}),"\n",(0,i.jsx)(n.p,{children:"You can provide your own admin layout template."}),"\n",(0,i.jsx)(n.p,{children:"First create a layout view template in your application and define the View Manager template map to list\nyour custom layout template. Then modify the LmcAdmin configuration to define the layout that LmcAdmin will use:"}),"\n",(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"config/autoload/lmcadmin.global.php"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-php",children:"return [\n 'lmc_admin' => [\n 'admin_layout_template' => 'myapp/myadminlayout',\n ],\n];\n"})}),"\n",(0,i.jsx)(n.p,{children:"And in your module config:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-php",children:"return [\n 'view_manager' => [\n 'template_map' => [\n 'myapp/myadminlayout' => '/path/to/your/layout/template'\n ],\n ],\n];\n"})}),"\n",(0,i.jsxs)(n.h2,{id:"override-the-view-template-for-the-admincontroller-index-action",children:["Override the view template for the ",(0,i.jsx)(n.code,{children:"AdminController"})," index action"]}),"\n",(0,i.jsxs)(n.p,{children:["You can also define the template rendered when you visit ",(0,i.jsx)(n.code,{children:"/admin"})," which defaults to ",(0,i.jsx)(n.code,{children:"AdminController::indexAction()"})]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"AdminController::indexAction()"})," will return a View Model using the template ",(0,i.jsx)(n.code,{children:"lmc-admin/admin/index"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"Therefore, you can override the template via the View Manager template map."}),"\n",(0,i.jsx)(n.p,{children:"In your module config:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-php",children:"return [\n 'view_manager' => [\n 'template_map' => [\n 'lmc-admin/admin/index' => '/path/to/your/template'\n ],\n ],\n];\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Make sure your module is registered in the ",(0,i.jsx)(n.code,{children:"modules.config.php"})," ",(0,i.jsx)(n.em,{children:(0,i.jsx)(n.strong,{children:"after"})})," ",(0,i.jsx)(n.code,{children:"LmcAdmin"})," to override LmcAdmin configuration."]}),"\n",(0,i.jsx)(n.h2,{id:"disable-layout",children:"Disable layout"}),"\n",(0,i.jsx)(n.p,{children:"If you need a page within an admin controller where only the view template is rendered,\nyou can disable the layout.\nLayout disabling works just like any other page outside LmcAdmin where you disable the layout.\nTo accomplish this, you must set the view model to 'terminal' in your controller:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-php",children:"class MyAdminController extends AbstractActionController\n {\n public function someAction()\n {\n $model = new ViewModel;\n $model->setTerminal(true);\n return $model;\n }\n}\n"})})]})}function m(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>l,x:()=>d});var i=t(6540);const a={},o=i.createContext(a);function l(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:l(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/4fbd1f13.8ccdde38.js b/assets/js/4fbd1f13.8ccdde38.js new file mode 100644 index 0000000..8397668 --- /dev/null +++ b/assets/js/4fbd1f13.8ccdde38.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[970],{5048:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>s,contentTitle:()=>r,default:()=>u,frontMatter:()=>c,metadata:()=>a,toc:()=>d});var i=t(4848),o=t(8453);const c={sidebar_position:4},r="Authorization",a={id:"Authorization",title:"Authorization",description:"It is typical to implement some form of authorization to restrict access to admin functions to users with",source:"@site/docs/Authorization.md",sourceDirName:".",slug:"/Authorization",permalink:"/LmcAdmin/docs/next/Authorization",draft:!1,unlisted:!1,editUrl:"https://github.com/lm-commons/lmcadmin/tree/master/docs/docs/Authorization.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"documentationSidebar",previous:{title:"Navigation",permalink:"/LmcAdmin/docs/next/Navigation"},next:{title:"Views & Layouts",permalink:"/LmcAdmin/docs/next/ViewLayout"}},s={},d=[{value:"Authorization using LmcRbacMvc",id:"authorization-using-lmcrbacmvc",level:2}];function m(n){const e={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",...(0,o.R)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.header,{children:(0,i.jsx)(e.h1,{id:"authorization",children:"Authorization"})}),"\n",(0,i.jsx)(e.p,{children:"It is typical to implement some form of authorization to restrict access to admin functions to users with\nadministrative privileges."}),"\n",(0,i.jsx)(e.p,{children:"LmcAdmin does not prescribe a specific authorization framework."}),"\n",(0,i.jsxs)(e.p,{children:["However, LmcAdmin can enable authorization via ",(0,i.jsx)(e.a,{href:"https://lm-commons.github.io/LmcRbac",children:"LmcRbacMvc"}),"."]}),"\n",(0,i.jsx)(e.h2,{id:"authorization-using-lmcrbacmvc",children:"Authorization using LmcRbacMvc"}),"\n",(0,i.jsxs)(e.p,{children:["Configuration for LmcRbacMvc module is provided to easily configure LmcAdmin.\nAuthorization enables you to restrict access to ",(0,i.jsx)(e.code,{children:"/admin"})," and every other page under LmcAdmin."]}),"\n",(0,i.jsx)(e.p,{children:"To enable access restriction with LmcRbacMvc, install the module and enable it in your application."}),"\n",(0,i.jsxs)(e.p,{children:["There is a sample LmcRbacMvc configuration in the",(0,i.jsx)(e.code,{children:"config/lmcadmin.global.php.dist"})," file.\nCopy this file over to your ",(0,i.jsx)(e.code,{children:"config/autoload"})," directory."]}),"\n",(0,i.jsxs)(e.p,{children:["It provides LmcRbacMvc configuration to restrict access to users for the ",(0,i.jsx)(e.code,{children:"/admin"}),' route.\nOnly users in the "admin" group are allowed to access LmcAdmin pages.']}),"\n",(0,i.jsx)(e.p,{children:"Uncomment the following lines:"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-php",children:"return [\n /**\n * Suggested LmcRbacMvc configuration for RBAC\n */\n 'lmc_rbac' => [\n 'guards' => [\n 'Lmc\\Rbac\\Mvc\\Guard\\RouteGuard' => [\n 'lmcadmin*' => ['admin'],\n ],\n ],\n ],\n];\n"})}),"\n",(0,i.jsxs)(e.p,{children:["Instructions for further configuration of LmcRbacMvc are provided in the LmcRbacMvc ",(0,i.jsx)(e.a,{href:"https://lm-commons.github.io/LmcRbacMvc",children:"documentation"}),"."]})]})}function u(n={}){const{wrapper:e}={...(0,o.R)(),...n.components};return e?(0,i.jsx)(e,{...n,children:(0,i.jsx)(m,{...n})}):m(n)}},8453:(n,e,t)=>{t.d(e,{R:()=>r,x:()=>a});var i=t(6540);const o={},c=i.createContext(o);function r(n){const e=i.useContext(c);return i.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function a(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(o):n.components||o:r(n.components),i.createElement(c.Provider,{value:e},n.children)}}}]); \ No newline at end of file diff --git a/assets/js/4fbd1f13.fe815f46.js b/assets/js/4fbd1f13.fe815f46.js deleted file mode 100644 index ed0d4ec..0000000 --- a/assets/js/4fbd1f13.fe815f46.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[970],{5048:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>a,contentTitle:()=>r,default:()=>u,frontMatter:()=>c,metadata:()=>s,toc:()=>d});var i=t(4848),o=t(8453);const c={sidebar_position:4},r="Authorization",s={id:"Authorization",title:"Authorization",description:"It is highly suggested to implement some form of authorization to restrict access to admin functions to users with",source:"@site/docs/Authorization.md",sourceDirName:".",slug:"/Authorization",permalink:"/LmcAdmin/docs/next/Authorization",draft:!1,unlisted:!1,editUrl:"https://github.com/lm-commons/lmcadmin/tree/master/docs/docs/Authorization.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"documentationSidebar",previous:{title:"Navigation",permalink:"/LmcAdmin/docs/next/Navigation"},next:{title:"View & Layout",permalink:"/LmcAdmin/docs/next/ViewLayout"}},a={},d=[{value:"Authorization using LmcRbacMvc",id:"authorization-using-lmcrbacmvc",level:2}];function m(n){const e={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",...(0,o.R)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.header,{children:(0,i.jsx)(e.h1,{id:"authorization",children:"Authorization"})}),"\n",(0,i.jsx)(e.p,{children:"It is highly suggested to implement some form of authorization to restrict access to admin functions to users with\nadministrative privileges."}),"\n",(0,i.jsx)(e.p,{children:"LmcAdmin does not prescribe a specific authorization framework."}),"\n",(0,i.jsxs)(e.p,{children:["However, LmcAdmin can allow authorization via ",(0,i.jsx)(e.a,{href:"https://lm-commons.github.io/LmcRbac",children:"LmcRbacMvc"}),"."]}),"\n",(0,i.jsx)(e.h2,{id:"authorization-using-lmcrbacmvc",children:"Authorization using LmcRbacMvc"}),"\n",(0,i.jsxs)(e.p,{children:["Configuration for LmcRbacMvc module is provided to easily configure LmcAdmin.\nAuthorization enables you to restrict access to ",(0,i.jsx)(e.code,{children:"/admin"})," and every other page under LmcAdmin."]}),"\n",(0,i.jsx)(e.p,{children:"To enable access restriction with LmcRbacMvc, install the module and enable it in your application."}),"\n",(0,i.jsxs)(e.p,{children:["There is a sample LmcRbacMvc configuration in the",(0,i.jsx)(e.code,{children:"config/lmcadmin.global.php.dist"})," file.\nCopy this file over to your ",(0,i.jsx)(e.code,{children:"config/autoload"})," directory."]}),"\n",(0,i.jsxs)(e.p,{children:["It provides LmcRbacMvc configuration to restrict access to users for the ",(0,i.jsx)(e.code,{children:"/admin"}),' route.\nOnly users in the "admin" group are allowed to access LmcAdmin pages.']}),"\n",(0,i.jsx)(e.p,{children:"Uncomment the following lines:"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-php",children:"return [\n /**\n * Suggested LmcRbacMvc configuration for RBAC\n */\n 'lmc_rbac' => [\n 'guards' => [\n 'Lmc\\Rbac\\Mvc\\Guard\\RouteGuard' => [\n 'lmcadmin*' => ['admin'],\n ],\n ],\n ],\n];\n"})}),"\n",(0,i.jsxs)(e.p,{children:["Instructions for further configuration of LmcRbacMvc are provided in the LmcRbacMvc ",(0,i.jsx)(e.a,{href:"https://lm-commons.github.io/LmcRbacMvc",children:"documentation"}),"."]})]})}function u(n={}){const{wrapper:e}={...(0,o.R)(),...n.components};return e?(0,i.jsx)(e,{...n,children:(0,i.jsx)(m,{...n})}):m(n)}},8453:(n,e,t)=>{t.d(e,{R:()=>r,x:()=>s});var i=t(6540);const o={},c=i.createContext(o);function r(n){const e=i.useContext(c);return i.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function s(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(o):n.components||o:r(n.components),i.createElement(c.Provider,{value:e},n.children)}}}]); \ No newline at end of file diff --git a/assets/js/6505ded5.02bc1508.js b/assets/js/6505ded5.02bc1508.js deleted file mode 100644 index b568a70..0000000 --- a/assets/js/6505ded5.02bc1508.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[497],{9105:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>i,default:()=>l,frontMatter:()=>r,metadata:()=>c,toc:()=>s});var a=t(4848),o=t(8453);const r={sidebar_label:"From v1 to v2"},i="Upgrading from v1 to v2",c={id:"Upgrading/to-v2",title:"Upgrading from v1 to v2",description:"LmcAdmin v2 is a major version upgrade with many breaking changes that prevent",source:"@site/docs/Upgrading/to-v2.md",sourceDirName:"Upgrading",slug:"/Upgrading/to-v2",permalink:"/LmcAdmin/docs/next/Upgrading/to-v2",draft:!1,unlisted:!1,editUrl:"https://github.com/lm-commons/lmcadmin/tree/master/docs/docs/Upgrading/to-v2.md",tags:[],version:"current",frontMatter:{sidebar_label:"From v1 to v2"},sidebar:"documentationSidebar",previous:{title:"View & Layout",permalink:"/LmcAdmin/docs/next/ViewLayout"}},d={},s=[{value:"Namespace change",id:"namespace-change",level:3},{value:"Default layout template name",id:"default-layout-template-name",level:3},{value:"Configuration key",id:"configuration-key",level:3}];function m(e){const n={code:"code",h1:"h1",h3:"h3",header:"header",p:"p",...(0,o.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.header,{children:(0,a.jsx)(n.h1,{id:"upgrading-from-v1-to-v2",children:"Upgrading from v1 to v2"})}),"\n",(0,a.jsx)(n.p,{children:"LmcAdmin v2 is a major version upgrade with many breaking changes that prevent\nstraightforward upgrading."}),"\n",(0,a.jsx)(n.h3,{id:"namespace-change",children:"Namespace change"}),"\n",(0,a.jsx)(n.p,{children:"The namespace has been changed from LmcAdmin to Lmc\\Admin."}),"\n",(0,a.jsxs)(n.p,{children:["Please review your code to replace references to the ",(0,a.jsx)(n.code,{children:"LmcAdmin"})," namespace\nby the ",(0,a.jsx)(n.code,{children:"Lmc\\Admin"})," namespace."]}),"\n",(0,a.jsx)(n.h3,{id:"default-layout-template-name",children:"Default layout template name"}),"\n",(0,a.jsxs)(n.p,{children:["The default layout template has been changed from ",(0,a.jsx)(n.code,{children:"layout/admin"})," to ",(0,a.jsx)(n.code,{children:"layout/lmcadmin"}),"."]}),"\n",(0,a.jsx)(n.h3,{id:"configuration-key",children:"Configuration key"}),"\n",(0,a.jsxs)(n.p,{children:["The configuration key for LmcAdmin was changed from ",(0,a.jsx)(n.code,{children:"lmcadmin"})," to ",(0,a.jsx)(n.code,{children:"lmc_admin"}),"."]})]})}function l(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(m,{...e})}):m(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>c});var a=t(6540);const o={},r=a.createContext(o);function i(e){const n=a.useContext(r);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),a.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6505ded5.d3a12ce9.js b/assets/js/6505ded5.d3a12ce9.js new file mode 100644 index 0000000..6c6702f --- /dev/null +++ b/assets/js/6505ded5.d3a12ce9.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[497],{9105:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>i,default:()=>l,frontMatter:()=>r,metadata:()=>c,toc:()=>s});var a=t(4848),o=t(8453);const r={sidebar_label:"From v1 to v2"},i="Upgrading from v1 to v2",c={id:"Upgrading/to-v2",title:"Upgrading from v1 to v2",description:"LmcAdmin v2 is a major version upgrade with many breaking changes that prevent",source:"@site/docs/Upgrading/to-v2.md",sourceDirName:"Upgrading",slug:"/Upgrading/to-v2",permalink:"/LmcAdmin/docs/next/Upgrading/to-v2",draft:!1,unlisted:!1,editUrl:"https://github.com/lm-commons/lmcadmin/tree/master/docs/docs/Upgrading/to-v2.md",tags:[],version:"current",frontMatter:{sidebar_label:"From v1 to v2"},sidebar:"documentationSidebar",previous:{title:"Views & Layouts",permalink:"/LmcAdmin/docs/next/ViewLayout"}},d={},s=[{value:"Namespace change",id:"namespace-change",level:3},{value:"Default layout template name",id:"default-layout-template-name",level:3},{value:"Configuration key",id:"configuration-key",level:3}];function m(e){const n={code:"code",h1:"h1",h3:"h3",header:"header",p:"p",...(0,o.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.header,{children:(0,a.jsx)(n.h1,{id:"upgrading-from-v1-to-v2",children:"Upgrading from v1 to v2"})}),"\n",(0,a.jsx)(n.p,{children:"LmcAdmin v2 is a major version upgrade with many breaking changes that prevent\nstraightforward upgrading."}),"\n",(0,a.jsx)(n.h3,{id:"namespace-change",children:"Namespace change"}),"\n",(0,a.jsx)(n.p,{children:"The namespace has been changed from LmcAdmin to Lmc\\Admin."}),"\n",(0,a.jsxs)(n.p,{children:["Please review your code to replace references to the ",(0,a.jsx)(n.code,{children:"LmcAdmin"})," namespace\nby the ",(0,a.jsx)(n.code,{children:"Lmc\\Admin"})," namespace."]}),"\n",(0,a.jsx)(n.h3,{id:"default-layout-template-name",children:"Default layout template name"}),"\n",(0,a.jsxs)(n.p,{children:["The default layout template has been changed from ",(0,a.jsx)(n.code,{children:"layout/admin"})," to ",(0,a.jsx)(n.code,{children:"layout/lmcadmin"}),"."]}),"\n",(0,a.jsx)(n.h3,{id:"configuration-key",children:"Configuration key"}),"\n",(0,a.jsxs)(n.p,{children:["The configuration key for LmcAdmin was changed from ",(0,a.jsx)(n.code,{children:"lmcadmin"})," to ",(0,a.jsx)(n.code,{children:"lmc_admin"}),"."]})]})}function l(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(m,{...e})}):m(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>c});var a=t(6540);const o={},r=a.createContext(o);function i(e){const n=a.useContext(r);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),a.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/891b7c56.05843359.js b/assets/js/891b7c56.05843359.js deleted file mode 100644 index b59ddbf..0000000 --- a/assets/js/891b7c56.05843359.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[572],{2662:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":"unreleased","badge":true,"noIndex":false,"className":"docs-version-current","isLast":false,"docsSidebars":{"documentationSidebar":[{"type":"link","label":"Getting Started","href":"/LmcAdmin/docs/next/Introduction","docId":"Introduction","unlisted":false},{"type":"link","label":"Routes","href":"/LmcAdmin/docs/next/Routes","docId":"Routes","unlisted":false},{"type":"link","label":"Navigation","href":"/LmcAdmin/docs/next/Navigation","docId":"Navigation","unlisted":false},{"type":"link","label":"Authorization","href":"/LmcAdmin/docs/next/Authorization","docId":"Authorization","unlisted":false},{"type":"link","label":"View & Layout","href":"/LmcAdmin/docs/next/ViewLayout","docId":"ViewLayout","unlisted":false},{"type":"category","label":"Upgrading","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"From v1 to v2","href":"/LmcAdmin/docs/next/Upgrading/to-v2","docId":"Upgrading/to-v2","unlisted":false}]}]},"docs":{"Authorization":{"id":"Authorization","title":"Authorization","description":"It is highly suggested to implement some form of authorization to restrict access to admin functions to users with","sidebar":"documentationSidebar"},"Introduction":{"id":"Introduction","title":"Getting Started","description":"LmcAdmin is a low-level module that helps Laminas MVC Framework developers to create an admin interface.","sidebar":"documentationSidebar"},"Navigation":{"id":"Navigation","title":"Navigation","description":"LmcAdmin provides a dedicated navigation structure for the admin interface.","sidebar":"documentationSidebar"},"Routes":{"id":"Routes","title":"Routes","description":"LmcAdmin enables a single route named lmcadmin, which is a literal route and mapped to the url /admin.","sidebar":"documentationSidebar"},"Upgrading/to-v2":{"id":"Upgrading/to-v2","title":"Upgrading from v1 to v2","description":"LmcAdmin v2 is a major version upgrade with many breaking changes that prevent","sidebar":"documentationSidebar"},"ViewLayout":{"id":"ViewLayout","title":"View & Layout","description":"LmcAdmin includes an admin layout and index view script, so LmcAdmin works out of the box. These view scripts are fully","sidebar":"documentationSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/891b7c56.8125229f.js b/assets/js/891b7c56.8125229f.js new file mode 100644 index 0000000..140bb0a --- /dev/null +++ b/assets/js/891b7c56.8125229f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[572],{2662:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":"unreleased","badge":true,"noIndex":false,"className":"docs-version-current","isLast":false,"docsSidebars":{"documentationSidebar":[{"type":"link","label":"Getting Started","href":"/LmcAdmin/docs/next/Introduction","docId":"Introduction","unlisted":false},{"type":"link","label":"Routes","href":"/LmcAdmin/docs/next/Routes","docId":"Routes","unlisted":false},{"type":"link","label":"Navigation","href":"/LmcAdmin/docs/next/Navigation","docId":"Navigation","unlisted":false},{"type":"link","label":"Authorization","href":"/LmcAdmin/docs/next/Authorization","docId":"Authorization","unlisted":false},{"type":"link","label":"Views & Layouts","href":"/LmcAdmin/docs/next/ViewLayout","docId":"ViewLayout","unlisted":false},{"type":"category","label":"Upgrading","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"From v1 to v2","href":"/LmcAdmin/docs/next/Upgrading/to-v2","docId":"Upgrading/to-v2","unlisted":false}]}]},"docs":{"Authorization":{"id":"Authorization","title":"Authorization","description":"It is typical to implement some form of authorization to restrict access to admin functions to users with","sidebar":"documentationSidebar"},"Introduction":{"id":"Introduction","title":"Getting Started","description":"LmcAdmin is a low-level module that helps Laminas MVC Framework developers to create an admin interface.","sidebar":"documentationSidebar"},"Navigation":{"id":"Navigation","title":"Navigation","description":"LmcAdmin provides a dedicated navigation structure for the admin interface.","sidebar":"documentationSidebar"},"Routes":{"id":"Routes","title":"Routes","description":"LmcAdmin defines a single route named lmcadmin, which is a Laminas\\\\Router\\\\Http\\\\Literal route and mapped to the url /admin.","sidebar":"documentationSidebar"},"Upgrading/to-v2":{"id":"Upgrading/to-v2","title":"Upgrading from v1 to v2","description":"LmcAdmin v2 is a major version upgrade with many breaking changes that prevent","sidebar":"documentationSidebar"},"ViewLayout":{"id":"ViewLayout","title":"Views & Layouts","description":"LmcAdmin includes an admin layout template and an index view template, such that LmcAdmin works out of the box. These view templates are fully","sidebar":"documentationSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/907b9470.bb12813f.js b/assets/js/907b9470.bb12813f.js new file mode 100644 index 0000000..f8eab97 --- /dev/null +++ b/assets/js/907b9470.bb12813f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[433],{211:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>l,contentTitle:()=>d,default:()=>h,frontMatter:()=>i,metadata:()=>s,toc:()=>c});var t=o(4848),r=o(8453);const i={sidebar_position:2},d="Routes",s={id:"Routes",title:"Routes",description:"LmcAdmin defines a single route named lmcadmin, which is a Laminas\\Router\\Http\\Literal route and mapped to the url /admin.",source:"@site/docs/Routes.md",sourceDirName:".",slug:"/Routes",permalink:"/LmcAdmin/docs/next/Routes",draft:!1,unlisted:!1,editUrl:"https://github.com/lm-commons/lmcadmin/tree/master/docs/docs/Routes.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"documentationSidebar",previous:{title:"Getting Started",permalink:"/LmcAdmin/docs/next/Introduction"},next:{title:"Navigation",permalink:"/LmcAdmin/docs/next/Navigation"}},l={},c=[{value:"Add child route",id:"add-child-route",level:2},{value:"Change the /admin url",id:"change-the-admin-url",level:2},{value:"Change the controller behind /admin",id:"change-the-controller-behind-admin",level:2}];function a(e){const n={code:"code",em:"em",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",strong:"strong",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"routes",children:"Routes"})}),"\n",(0,t.jsxs)(n.p,{children:["LmcAdmin defines a single route named ",(0,t.jsx)(n.code,{children:"lmcadmin"}),", which is a ",(0,t.jsx)(n.code,{children:"Laminas\\Router\\Http\\Literal"})," route and mapped to the url ",(0,t.jsx)(n.code,{children:"/admin"}),".\nYou can create child routes under ",(0,t.jsx)(n.code,{children:"lmcadmin"})," so you can enable urls like ",(0,t.jsx)(n.code,{children:"/admin/users"})," or ",(0,t.jsx)(n.code,{children:"/admin/roles/permissions"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"add-child-route",children:"Add child route"}),"\n",(0,t.jsxs)(n.p,{children:["To register a route as child route, the following example takes the option you name the route ",(0,t.jsx)(n.code,{children:"users"}),".\nThe complete path should look like ",(0,t.jsx)(n.code,{children:"/admin/users"}),", so ",(0,t.jsx)(n.code,{children:"users"})," is a literal route with the route value ",(0,t.jsx)(n.code,{children:"/users"}),".\nSay you want this route to connect to the ",(0,t.jsx)(n.code,{children:"MyAdminModule\\Controller\\UsersController"})," controller and the ",(0,t.jsx)(n.code,{children:"index"})," action,\ncreate this config in your ",(0,t.jsx)(n.code,{children:"module.config.php"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-php",children:"'router' => [\n 'routes' => [\n 'lmcadmin' => [\n 'child_routes' => [\n 'users' => [\n 'type' => Laminas\\Router\\Http\\Literal::class,\n 'options' => [\n 'route' => '/users',\n 'defaults' => [\n 'controller' => MyAdminModule\\Controller\\UsersController::class,\n 'action' => 'index',\n ],\n ],\n ],\n ],\n ],\n ],\n],\n"})}),"\n",(0,t.jsxs)(n.h2,{id:"change-the-admin-url",children:["Change the ",(0,t.jsx)(n.code,{children:"/admin"})," url"]}),"\n",(0,t.jsxs)(n.p,{children:["If you want your admin interface at ",(0,t.jsx)(n.code,{children:"/backend"})," or something else, you must override the value of the route. In the\nfollowing config, the ",(0,t.jsx)(n.code,{children:"/admin"})," route value is replaced with ",(0,t.jsx)(n.code,{children:"/backend"}),". Make sure this is enabled in a config where the\nmodule is registered ",(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"after"})})," LmcAdmin (otherwise, the config will not overwrite LmcAdmin's configuration):"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-php",children:"'router' => [\n 'routes' => [\n 'lmcadmin' => [\n 'options' => [\n 'route' => '/backend',\n ],\n ],\n],\n"})}),"\n",(0,t.jsxs)(n.h2,{id:"change-the-controller-behind-admin",children:["Change the controller behind ",(0,t.jsx)(n.code,{children:"/admin"})]}),"\n",(0,t.jsxs)(n.p,{children:["By default, the ",(0,t.jsx)(n.code,{children:"/admin"})," url links to the ",(0,t.jsx)(n.code,{children:"LmcAdmin\\Controller\\AdminController"})," controller.\n",(0,t.jsx)(n.code,{children:"LmcAdmin\\Controller\\AdminController"})," is an simple action that only returns a simple view script.\nIf you want, for example, to create a dashboard on the admin index page, you probably need to point the route to\nanother controller.\nIn the following config, the ",(0,t.jsx)(n.code,{children:"lmcadmin"})," route's controller is replaced with ",(0,t.jsx)(n.code,{children:"MyAdminModule/Controller/AdminController"}),"\nand the action is set to ",(0,t.jsx)(n.code,{children:"dashboard"}),".\nMake sure this is enabled in a config where the module is registered ",(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"later"})})," LmcAdmin (otherwise, the config will\nnot overwrite LmcAdmin's configuration):"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-php",children:"'router' => [\n 'routes' => [\n 'lmcadmin' => [\n 'options' => [\n 'defaults' => [\n 'controller' => MyModule\\Controller\\AdminController::class,\n 'action' => 'dashboard',\n ],\n ],\n ],\n ],\n],\n"})})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},8453:(e,n,o)=>{o.d(n,{R:()=>d,x:()=>s});var t=o(6540);const r={},i=t.createContext(r);function d(e){const n=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:d(e.components),t.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/907b9470.d86dd096.js b/assets/js/907b9470.d86dd096.js deleted file mode 100644 index 4e74b92..0000000 --- a/assets/js/907b9470.d86dd096.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[433],{211:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>l,contentTitle:()=>d,default:()=>h,frontMatter:()=>i,metadata:()=>s,toc:()=>c});var t=o(4848),r=o(8453);const i={sidebar_position:2},d="Routes",s={id:"Routes",title:"Routes",description:"LmcAdmin enables a single route named lmcadmin, which is a literal route and mapped to the url /admin.",source:"@site/docs/Routes.md",sourceDirName:".",slug:"/Routes",permalink:"/LmcAdmin/docs/next/Routes",draft:!1,unlisted:!1,editUrl:"https://github.com/lm-commons/lmcadmin/tree/master/docs/docs/Routes.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"documentationSidebar",previous:{title:"Getting Started",permalink:"/LmcAdmin/docs/next/Introduction"},next:{title:"Navigation",permalink:"/LmcAdmin/docs/next/Navigation"}},l={},c=[{value:"Add child route",id:"add-child-route",level:2},{value:"Change the /admin url",id:"change-the-admin-url",level:2},{value:"Change the controller behind /admin",id:"change-the-controller-behind-admin",level:2}];function a(e){const n={code:"code",em:"em",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",strong:"strong",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"routes",children:"Routes"})}),"\n",(0,t.jsxs)(n.p,{children:["LmcAdmin enables a single route named ",(0,t.jsx)(n.code,{children:"lmcadmin"}),", which is a literal route and mapped to the url ",(0,t.jsx)(n.code,{children:"/admin"}),".\nYou can create child routes under ",(0,t.jsx)(n.code,{children:"lmcadmin"})," so you enable urls like ",(0,t.jsx)(n.code,{children:"/admin/users"})," or ",(0,t.jsx)(n.code,{children:"/admin/roles/permissions"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"add-child-route",children:"Add child route"}),"\n",(0,t.jsxs)(n.p,{children:["To register a route as child route, the following example takes the option you name the route ",(0,t.jsx)(n.code,{children:"users"}),".\nThe complete path should look like ",(0,t.jsx)(n.code,{children:"/admin/users"}),", so ",(0,t.jsx)(n.code,{children:"users"})," is a literal route with the route value ",(0,t.jsx)(n.code,{children:"/users"}),".\nSay you want this route to connect to the ",(0,t.jsx)(n.code,{children:"MyAdminModule\\Controller\\UsersController"})," controller and the ",(0,t.jsx)(n.code,{children:"index"})," action,\ncreate this config in your ",(0,t.jsx)(n.code,{children:"module.config.php"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-php",children:"'router' => [\n 'routes' => [\n 'lmcadmin' => [\n 'child_routes' => [\n 'users' => [\n 'type' => 'literal',\n 'options' => [\n 'route' => '/users',\n 'defaults' => [\n 'controller' => 'MyAdminModule\\Controller\\UsersController::class',\n 'action' => 'index',\n ],\n ],\n ],\n ],\n ],\n ],\n],\n"})}),"\n",(0,t.jsxs)(n.h2,{id:"change-the-admin-url",children:["Change the ",(0,t.jsx)(n.code,{children:"/admin"})," url"]}),"\n",(0,t.jsxs)(n.p,{children:["If you want your admin interface at ",(0,t.jsx)(n.code,{children:"/backend"})," or something else, you must override the value of the route. In the\nfollowing config, the ",(0,t.jsx)(n.code,{children:"/admin"})," route value is replaced with ",(0,t.jsx)(n.code,{children:"/backend"}),". Make sure this is enabled in a config where the\nmodule is registered ",(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"after"})})," LmcAdmin (otherwise, the config will not overwrite LmcAdmin's configuration):"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-php",children:"'router' => [\n 'routes' => [\n 'lmcadmin' => [\n 'options' => [\n 'route' => '/backend',\n ],\n ],\n],\n"})}),"\n",(0,t.jsxs)(n.h2,{id:"change-the-controller-behind-admin",children:["Change the controller behind ",(0,t.jsx)(n.code,{children:"/admin"})]}),"\n",(0,t.jsxs)(n.p,{children:["By default, the ",(0,t.jsx)(n.code,{children:"/admin"})," url links to the ",(0,t.jsx)(n.code,{children:"LmcAdmin\\Controller\\AdminController"})," controller.\nIt's an empty action and a simple view script is rendered.\nIf you want, for example, to create a dashboard on the admin index page, you probably need to point the route to\nanother controller.\nIn the following config, the ",(0,t.jsx)(n.code,{children:"lmcadmin"})," route's controller is replaced with ",(0,t.jsx)(n.code,{children:"MyAdminModule/Controller/AdminController"}),"\nand the action is set to ",(0,t.jsx)(n.code,{children:"dashboard"}),".\nMake sure this is enabled in a config where the module is registered ",(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"later"})})," LmcAdmin (otherwise, the config will\nnot overwrite LmcAdmin's configuration):"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-php",children:"'router' => [\n 'routes' => [\n 'lmcadmin' => [\n 'options' => [\n 'defaults' => [\n 'controller' => 'MyModule/Controller/AdminController',\n 'action' => 'dashboard',\n ],\n ],\n ],\n ],\n],\n"})})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},8453:(e,n,o)=>{o.d(n,{R:()=>d,x:()=>s});var t=o(6540);const r={},i=t.createContext(r);function d(e){const n=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:d(e.components),t.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e0a19902.8552b682.js b/assets/js/e0a19902.8552b682.js new file mode 100644 index 0000000..35a509d --- /dev/null +++ b/assets/js/e0a19902.8552b682.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[494],{1217:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>m,frontMatter:()=>r,metadata:()=>s,toc:()=>c});var o=t(4848),i=t(8453);const r={sidebar_position:1},a="Getting Started",s={id:"Introduction",title:"Getting Started",description:"LmcAdmin is a low-level module that helps Laminas MVC Framework developers to create an admin interface.",source:"@site/docs/Introduction.md",sourceDirName:".",slug:"/Introduction",permalink:"/LmcAdmin/docs/next/Introduction",draft:!1,unlisted:!1,editUrl:"https://github.com/lm-commons/lmcadmin/tree/master/docs/docs/Introduction.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"documentationSidebar",next:{title:"Routes",permalink:"/LmcAdmin/docs/next/Routes"}},l={},c=[{value:"Requirements",id:"requirements",level:2},{value:"Installation",id:"installation",level:2}];function d(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"getting-started",children:"Getting Started"})}),"\n",(0,o.jsx)(n.p,{children:"LmcAdmin is a low-level module that helps Laminas MVC Framework developers to create an admin interface.\nThe module allows to have a uniform layout, navigation structure and routing scheme.\nYou can create controllers routed as a child of LmcAdmin, so you can easily change the (root) url, access control\nand other properties.\nThe navigation is also flexible, to allow you having a structure built of pages in the admin interface with menus,\nbreadcrumbs and other links."}),"\n",(0,o.jsx)(n.h2,{id:"requirements",children:"Requirements"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"PHP 8.1 and later"}),"\n",(0,o.jsx)(n.li,{children:"Laminas MVC 3.0 or later"}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,o.jsx)(n.p,{children:"Install the module:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"$ composer require lm-commons/lmc-admin\n"})}),"\n",(0,o.jsx)(n.p,{children:"You will be prompted by the laminas-component-installer plugin to inject LM-Commons\\LmcAdmin."}),"\n",(0,o.jsx)(n.admonition,{title:"Manual installation:",type:"note",children:(0,o.jsxs)(n.p,{children:["Enable the module by adding ",(0,o.jsx)(n.code,{children:"Lmc\\Admin"})," key to your ",(0,o.jsx)(n.code,{children:"application.config.php"})," or ",(0,o.jsx)(n.code,{children:"modules.config.php"})," file for Laminas MVC\napplications."]})}),"\n",(0,o.jsxs)(n.p,{children:["Customize the module by copy-pasting\nthe ",(0,o.jsx)(n.code,{children:"config/lmcadmin.global.php.dist"})," file to your ",(0,o.jsx)(n.code,{children:"config/autoload"})," folder."]})]})}function m(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>s});var o=t(6540);const i={},r=o.createContext(i);function a(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e0a19902.f1220568.js b/assets/js/e0a19902.f1220568.js deleted file mode 100644 index 3c239f6..0000000 --- a/assets/js/e0a19902.f1220568.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[494],{1217:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>m,frontMatter:()=>r,metadata:()=>s,toc:()=>c});var o=t(4848),i=t(8453);const r={sidebar_position:1},a="Getting Started",s={id:"Introduction",title:"Getting Started",description:"LmcAdmin is a low-level module that helps Laminas MVC Framework developers to create an admin interface.",source:"@site/docs/Introduction.md",sourceDirName:".",slug:"/Introduction",permalink:"/LmcAdmin/docs/next/Introduction",draft:!1,unlisted:!1,editUrl:"https://github.com/lm-commons/lmcadmin/tree/master/docs/docs/Introduction.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"documentationSidebar",next:{title:"Routes",permalink:"/LmcAdmin/docs/next/Routes"}},l={},c=[{value:"Requirements",id:"requirements",level:2},{value:"Installation",id:"installation",level:2}];function d(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",ul:"ul",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"getting-started",children:"Getting Started"})}),"\n",(0,o.jsx)(n.p,{children:"LmcAdmin is a low-level module that helps Laminas MVC Framework developers to create an admin interface.\nThe module allows to have a uniform layout, navigation structure and routing scheme.\nYou can create controllers routed as a child of LmcAdmin, so you can easily change the (root) url, access control\nand other properties.\nThe navigation is also flexible, to allow you having a structure built of pages in the admin interface with menus,\nbreadcrumbs and other links."}),"\n",(0,o.jsx)(n.h2,{id:"requirements",children:"Requirements"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"PHP 8.1 and later"}),"\n",(0,o.jsx)(n.li,{children:"Laminas MVC 3.0 or later"}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,o.jsx)(n.p,{children:"Install the module:"}),"\n",(0,o.jsx)(n.p,{children:"$ composer require lm-commons/lmc-admin"}),"\n",(0,o.jsx)(n.p,{children:"You will be prompted by the laminas-component-installer plugin to inject LM-Commons\\LmcAdmin."}),"\n",(0,o.jsx)(n.admonition,{title:"Manual installation:",type:"note",children:(0,o.jsxs)(n.p,{children:["Enable the module by adding ",(0,o.jsx)(n.code,{children:"Lmc\\admin"})," key to your ",(0,o.jsx)(n.code,{children:"application.config.php"})," or ",(0,o.jsx)(n.code,{children:"modules.config.php"})," file for Laminas MVC\napplications."]})}),"\n",(0,o.jsxs)(n.p,{children:["Customize the module by copy-pasting\nthe ",(0,o.jsx)(n.code,{children:"config/lmcadmin.global.php.dist"})," file to your ",(0,o.jsx)(n.code,{children:"config/autoload"})," folder."]})]})}function m(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>s});var o=t(6540);const i={},r=o.createContext(i);function a(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.1f129c02.js b/assets/js/runtime~main.6793121d.js similarity index 82% rename from assets/js/runtime~main.1f129c02.js rename to assets/js/runtime~main.6793121d.js index 49e22a1..28c4d26 100644 --- a/assets/js/runtime~main.1f129c02.js +++ b/assets/js/runtime~main.6793121d.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,t,r,c,f={},d={};function o(e){var a=d[e];if(void 0!==a)return a.exports;var t=d[e]={exports:{}};return f[e].call(t.exports,t,t.exports,o),t.exports}o.m=f,e=[],o.O=(a,t,r,c)=>{if(!t){var f=1/0;for(i=0;i=c)&&Object.keys(o.O).every((e=>o.O[e](t[n])))?t.splice(n--,1):(d=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[t,r,c]},o.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return o.d(a,{a:a}),a},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var c=Object.create(null);o.r(c);var f={};a=a||[null,t({}),t([]),t(t)];for(var d=2&r&&e;"object"==typeof d&&!~a.indexOf(d);d=t(d))Object.getOwnPropertyNames(d).forEach((a=>f[a]=()=>e[a]));return f.default=()=>e,o.d(c,f),c},o.d=(e,a)=>{for(var t in a)o.o(a,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((a,t)=>(o.f[t](e,a),a)),[])),o.u=e=>"assets/js/"+({36:"8e789682",48:"a94703ab",61:"1f391b9e",88:"68b43929",98:"a7bd4aaa",104:"d6c62dfb",134:"393be207",196:"e089db47",209:"01a85c17",212:"621db11d",235:"a7456010",249:"ccc49370",274:"cc798a64",301:"a540a797",333:"91d161f8",343:"150078fa",401:"17896441",404:"28d13870",433:"907b9470",472:"814f3328",494:"e0a19902",497:"6505ded5",503:"849f900f",572:"891b7c56",576:"901c5bb3",591:"bc0bdf15",627:"24125592",634:"c4f5d8e4",643:"a6aa9e1f",647:"5e95c892",711:"9e4087bc",724:"b700b633",727:"7becd9e9",742:"aba21aa0",747:"6d7a56e8",755:"f8b66794",813:"6875c492",858:"36994c47",903:"acecf23e",969:"3f517846",970:"4fbd1f13",972:"11e5ea2c"}[e]||e)+"."+{36:"34cda310",48:"2b8bc70f",61:"18b7b9f7",88:"6fa85f29",98:"304ebab0",104:"aa7ffb55",134:"1ede1d0e",196:"846fb4dc",209:"c6db5ad2",212:"78f1db2e",235:"47cad1bc",237:"02cb92cf",249:"da604ad0",274:"d4db92de",301:"ce04244d",333:"0c4d3c65",343:"7425bad3",347:"0ea6fa59",401:"03addf38",404:"bd7a4831",433:"d86dd096",472:"06798c26",494:"f1220568",497:"02bc1508",503:"44cda07f",538:"3a792d77",572:"05843359",576:"393266c7",591:"a3e07026",627:"be3c7675",634:"bb3b7429",643:"e28bcaf4",647:"4bba8c03",711:"c2e72ae7",724:"707accfb",727:"a2340b66",742:"eb7bf6f2",747:"62114a1a",755:"74a133ff",813:"bad53a87",858:"5b43e344",903:"f1737a47",969:"15687c8e",970:"fe815f46",972:"3c2035e9"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),r={},c="docs:",o.l=(e,a,t,f)=>{if(r[e])r[e].push(a);else{var d,n;if(void 0!==t)for(var b=document.getElementsByTagName("script"),i=0;i{d.onerror=d.onload=null,clearTimeout(s);var c=r[e];if(delete r[e],d.parentNode&&d.parentNode.removeChild(d),c&&c.forEach((e=>e(t))),a)return a(t)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=l.bind(null,d.onerror),d.onload=l.bind(null,d.onload),n&&document.head.appendChild(d)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.p="/LmcAdmin/",o.gca=function(e){return e={17896441:"401",24125592:"627","8e789682":"36",a94703ab:"48","1f391b9e":"61","68b43929":"88",a7bd4aaa:"98",d6c62dfb:"104","393be207":"134",e089db47:"196","01a85c17":"209","621db11d":"212",a7456010:"235",ccc49370:"249",cc798a64:"274",a540a797:"301","91d161f8":"333","150078fa":"343","28d13870":"404","907b9470":"433","814f3328":"472",e0a19902:"494","6505ded5":"497","849f900f":"503","891b7c56":"572","901c5bb3":"576",bc0bdf15:"591",c4f5d8e4:"634",a6aa9e1f:"643","5e95c892":"647","9e4087bc":"711",b700b633:"724","7becd9e9":"727",aba21aa0:"742","6d7a56e8":"747",f8b66794:"755","6875c492":"813","36994c47":"858",acecf23e:"903","3f517846":"969","4fbd1f13":"970","11e5ea2c":"972"}[e]||e,o.p+o.u(e)},(()=>{var e={354:0,869:0};o.f.j=(a,t)=>{var r=o.o(e,a)?e[a]:void 0;if(0!==r)if(r)t.push(r[2]);else if(/^(354|869)$/.test(a))e[a]=0;else{var c=new Promise(((t,c)=>r=e[a]=[t,c]));t.push(r[2]=c);var f=o.p+o.u(a),d=new Error;o.l(f,(t=>{if(o.o(e,a)&&(0!==(r=e[a])&&(e[a]=void 0),r)){var c=t&&("load"===t.type?"missing":t.type),f=t&&t.target&&t.target.src;d.message="Loading chunk "+a+" failed.\n("+c+": "+f+")",d.name="ChunkLoadError",d.type=c,d.request=f,r[1](d)}}),"chunk-"+a,a)}},o.O.j=a=>0===e[a];var a=(a,t)=>{var r,c,f=t[0],d=t[1],n=t[2],b=0;if(f.some((a=>0!==e[a]))){for(r in d)o.o(d,r)&&(o.m[r]=d[r]);if(n)var i=n(o)}for(a&&a(t);b{"use strict";var e,a,t,r,c,f={},d={};function o(e){var a=d[e];if(void 0!==a)return a.exports;var t=d[e]={exports:{}};return f[e].call(t.exports,t,t.exports,o),t.exports}o.m=f,e=[],o.O=(a,t,r,c)=>{if(!t){var f=1/0;for(i=0;i=c)&&Object.keys(o.O).every((e=>o.O[e](t[b])))?t.splice(b--,1):(d=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[t,r,c]},o.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return o.d(a,{a:a}),a},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var c=Object.create(null);o.r(c);var f={};a=a||[null,t({}),t([]),t(t)];for(var d=2&r&&e;"object"==typeof d&&!~a.indexOf(d);d=t(d))Object.getOwnPropertyNames(d).forEach((a=>f[a]=()=>e[a]));return f.default=()=>e,o.d(c,f),c},o.d=(e,a)=>{for(var t in a)o.o(a,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((a,t)=>(o.f[t](e,a),a)),[])),o.u=e=>"assets/js/"+({36:"8e789682",48:"a94703ab",61:"1f391b9e",88:"68b43929",98:"a7bd4aaa",104:"d6c62dfb",134:"393be207",196:"e089db47",209:"01a85c17",212:"621db11d",235:"a7456010",249:"ccc49370",274:"cc798a64",301:"a540a797",333:"91d161f8",343:"150078fa",401:"17896441",404:"28d13870",433:"907b9470",472:"814f3328",494:"e0a19902",497:"6505ded5",503:"849f900f",572:"891b7c56",576:"901c5bb3",591:"bc0bdf15",627:"24125592",634:"c4f5d8e4",643:"a6aa9e1f",647:"5e95c892",711:"9e4087bc",724:"b700b633",727:"7becd9e9",742:"aba21aa0",747:"6d7a56e8",755:"f8b66794",813:"6875c492",858:"36994c47",903:"acecf23e",969:"3f517846",970:"4fbd1f13",972:"11e5ea2c"}[e]||e)+"."+{36:"34cda310",48:"2b8bc70f",61:"18b7b9f7",88:"6fa85f29",98:"304ebab0",104:"aa7ffb55",134:"1ede1d0e",196:"846fb4dc",209:"c6db5ad2",212:"78f1db2e",235:"47cad1bc",237:"02cb92cf",249:"da604ad0",274:"d4db92de",301:"ce04244d",333:"0c4d3c65",343:"7425bad3",347:"0ea6fa59",401:"03addf38",404:"bd7a4831",433:"bb12813f",472:"06798c26",494:"8552b682",497:"d3a12ce9",503:"44cda07f",538:"3a792d77",572:"8125229f",576:"393266c7",591:"a3e07026",627:"be3c7675",634:"bb3b7429",643:"e28bcaf4",647:"4bba8c03",711:"c2e72ae7",724:"707accfb",727:"a2340b66",742:"eb7bf6f2",747:"62114a1a",755:"74a133ff",813:"bad53a87",858:"5b43e344",903:"f1737a47",969:"15687c8e",970:"8ccdde38",972:"ad314188"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),r={},c="docs:",o.l=(e,a,t,f)=>{if(r[e])r[e].push(a);else{var d,b;if(void 0!==t)for(var n=document.getElementsByTagName("script"),i=0;i{d.onerror=d.onload=null,clearTimeout(s);var c=r[e];if(delete r[e],d.parentNode&&d.parentNode.removeChild(d),c&&c.forEach((e=>e(t))),a)return a(t)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=l.bind(null,d.onerror),d.onload=l.bind(null,d.onload),b&&document.head.appendChild(d)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.p="/LmcAdmin/",o.gca=function(e){return e={17896441:"401",24125592:"627","8e789682":"36",a94703ab:"48","1f391b9e":"61","68b43929":"88",a7bd4aaa:"98",d6c62dfb:"104","393be207":"134",e089db47:"196","01a85c17":"209","621db11d":"212",a7456010:"235",ccc49370:"249",cc798a64:"274",a540a797:"301","91d161f8":"333","150078fa":"343","28d13870":"404","907b9470":"433","814f3328":"472",e0a19902:"494","6505ded5":"497","849f900f":"503","891b7c56":"572","901c5bb3":"576",bc0bdf15:"591",c4f5d8e4:"634",a6aa9e1f:"643","5e95c892":"647","9e4087bc":"711",b700b633:"724","7becd9e9":"727",aba21aa0:"742","6d7a56e8":"747",f8b66794:"755","6875c492":"813","36994c47":"858",acecf23e:"903","3f517846":"969","4fbd1f13":"970","11e5ea2c":"972"}[e]||e,o.p+o.u(e)},(()=>{var e={354:0,869:0};o.f.j=(a,t)=>{var r=o.o(e,a)?e[a]:void 0;if(0!==r)if(r)t.push(r[2]);else if(/^(354|869)$/.test(a))e[a]=0;else{var c=new Promise(((t,c)=>r=e[a]=[t,c]));t.push(r[2]=c);var f=o.p+o.u(a),d=new Error;o.l(f,(t=>{if(o.o(e,a)&&(0!==(r=e[a])&&(e[a]=void 0),r)){var c=t&&("load"===t.type?"missing":t.type),f=t&&t.target&&t.target.src;d.message="Loading chunk "+a+" failed.\n("+c+": "+f+")",d.name="ChunkLoadError",d.type=c,d.request=f,r[1](d)}}),"chunk-"+a,a)}},o.O.j=a=>0===e[a];var a=(a,t)=>{var r,c,f=t[0],d=t[1],b=t[2],n=0;if(f.some((a=>0!==e[a]))){for(r in d)o.o(d,r)&&(o.m[r]=d[r]);if(b)var i=b(o)}for(a&&a(t);n Blog | LmcAdmin - + diff --git a/blog/archive.html b/blog/archive.html index 1e76180..d100358 100644 --- a/blog/archive.html +++ b/blog/archive.html @@ -5,7 +5,7 @@ Archive | LmcAdmin - + diff --git a/blog/authors.html b/blog/authors.html index c049486..3415e1c 100644 --- a/blog/authors.html +++ b/blog/authors.html @@ -5,7 +5,7 @@ Authors | LmcAdmin - + diff --git a/blog/new-documentation.html b/blog/new-documentation.html index dc851c8..a986f5d 100644 --- a/blog/new-documentation.html +++ b/blog/new-documentation.html @@ -5,7 +5,7 @@ New documentation | LmcAdmin - + diff --git a/blog/tags.html b/blog/tags.html index 8f17e82..b5f1f44 100644 --- a/blog/tags.html +++ b/blog/tags.html @@ -5,7 +5,7 @@ Tags | LmcAdmin - + diff --git a/blog/tags/admin.html b/blog/tags/admin.html index c9575e3..a33cf40 100644 --- a/blog/tags/admin.html +++ b/blog/tags/admin.html @@ -5,7 +5,7 @@ One post tagged with "admin" | LmcAdmin - + diff --git a/blog/tags/laminas.html b/blog/tags/laminas.html index b8d1558..c307ef5 100644 --- a/blog/tags/laminas.html +++ b/blog/tags/laminas.html @@ -5,7 +5,7 @@ One post tagged with "laminas" | LmcAdmin - + diff --git a/blog/tags/lm-commons.html b/blog/tags/lm-commons.html index 4397ecf..6c6ee4a 100644 --- a/blog/tags/lm-commons.html +++ b/blog/tags/lm-commons.html @@ -5,7 +5,7 @@ One post tagged with "LM-Commons" | LmcAdmin - + diff --git a/blog/tags/lmc-admin.html b/blog/tags/lmc-admin.html index c090cbb..b88aa52 100644 --- a/blog/tags/lmc-admin.html +++ b/blog/tags/lmc-admin.html @@ -5,7 +5,7 @@ One post tagged with "LmcAdmin" | LmcAdmin - + diff --git a/blog/tags/php.html b/blog/tags/php.html index bb22cda..a272a24 100644 --- a/blog/tags/php.html +++ b/blog/tags/php.html @@ -5,7 +5,7 @@ One post tagged with "PHP" | LmcAdmin - + diff --git a/docs/Authorization.html b/docs/Authorization.html index 0c774d9..1af15c3 100644 --- a/docs/Authorization.html +++ b/docs/Authorization.html @@ -5,7 +5,7 @@ Authorization | LmcAdmin - + diff --git a/docs/Introduction.html b/docs/Introduction.html index f69db7f..eab45b5 100644 --- a/docs/Introduction.html +++ b/docs/Introduction.html @@ -5,7 +5,7 @@ Introduction | LmcAdmin - + diff --git a/docs/Navigation.html b/docs/Navigation.html index 624f0b0..4e86cba 100644 --- a/docs/Navigation.html +++ b/docs/Navigation.html @@ -5,7 +5,7 @@ Navigation | LmcAdmin - + diff --git a/docs/Routes.html b/docs/Routes.html index e3b893e..950512f 100644 --- a/docs/Routes.html +++ b/docs/Routes.html @@ -5,7 +5,7 @@ Routes | LmcAdmin - + diff --git a/docs/ViewLayout.html b/docs/ViewLayout.html index af11f63..61134a0 100644 --- a/docs/ViewLayout.html +++ b/docs/ViewLayout.html @@ -5,7 +5,7 @@ View & Layout | LmcAdmin - + diff --git a/docs/next/Authorization.html b/docs/next/Authorization.html index e78f28d..454ed73 100644 --- a/docs/next/Authorization.html +++ b/docs/next/Authorization.html @@ -3,17 +3,17 @@ -Authorization | LmcAdmin +Authorization | LmcAdmin - + -
Version: Next

Authorization

-

It is highly suggested to implement some form of authorization to restrict access to admin functions to users with +

Version: Next

Authorization

+

It is typical to implement some form of authorization to restrict access to admin functions to users with administrative privileges.

LmcAdmin does not prescribe a specific authorization framework.

-

However, LmcAdmin can allow authorization via LmcRbacMvc.

+

However, LmcAdmin can enable authorization via LmcRbacMvc.

Authorization using LmcRbacMvc

Configuration for LmcRbacMvc module is provided to easily configure LmcAdmin. Authorization enables you to restrict access to /admin and every other page under LmcAdmin.

@@ -24,6 +24,6 @@

return [
/**
* Suggested LmcRbacMvc configuration for RBAC
*/
'lmc_rbac' => [
'guards' => [
'Lmc\Rbac\Mvc\Guard\RouteGuard' => [
'lmcadmin*' => ['admin'],
],
],
],
];

-

Instructions for further configuration of LmcRbacMvc are provided in the LmcRbacMvc documentation.

+

Instructions for further configuration of LmcRbacMvc are provided in the LmcRbacMvc documentation.

\ No newline at end of file diff --git a/docs/next/Introduction.html b/docs/next/Introduction.html index 37941ff..ceca241 100644 --- a/docs/next/Introduction.html +++ b/docs/next/Introduction.html @@ -5,11 +5,11 @@ Getting Started | LmcAdmin - + -
Version: Next

Getting Started

+
Version: Next

Getting Started

LmcAdmin is a low-level module that helps Laminas MVC Framework developers to create an admin interface. The module allows to have a uniform layout, navigation structure and routing scheme. You can create controllers routed as a child of LmcAdmin, so you can easily change the (root) url, access control @@ -23,9 +23,9 @@

Requirements

Installation

Install the module:

-

$ composer require lm-commons/lmc-admin

+
$ composer require lm-commons/lmc-admin

You will be prompted by the laminas-component-installer plugin to inject LM-Commons\LmcAdmin.

-
Manual installation:

Enable the module by adding Lmc\admin key to your application.config.php or modules.config.php file for Laminas MVC +

Manual installation:

Enable the module by adding Lmc\Admin key to your application.config.php or modules.config.php file for Laminas MVC applications.

Customize the module by copy-pasting the config/lmcadmin.global.php.dist file to your config/autoload folder.

diff --git a/docs/next/Navigation.html b/docs/next/Navigation.html index e332cc1..a8bc08f 100644 --- a/docs/next/Navigation.html +++ b/docs/next/Navigation.html @@ -5,11 +5,11 @@ Navigation | LmcAdmin - + -
Version: Next

Navigation

+
Version: Next

Navigation

LmcAdmin provides a dedicated navigation structure for the admin interface. By default, LmcAdmin initiates a Bootstrap layout on top the main admin navigation. These admin buttons are customizable.

diff --git a/docs/next/Routes.html b/docs/next/Routes.html index 739681d..e3624ee 100644 --- a/docs/next/Routes.html +++ b/docs/next/Routes.html @@ -3,21 +3,21 @@ -Routes | LmcAdmin +Routes | LmcAdmin - + -
Version: Next

Routes

-

LmcAdmin enables a single route named lmcadmin, which is a literal route and mapped to the url /admin. -You can create child routes under lmcadmin so you enable urls like /admin/users or /admin/roles/permissions.

+
Version: Next

Routes

+

LmcAdmin defines a single route named lmcadmin, which is a Laminas\Router\Http\Literal route and mapped to the url /admin. +You can create child routes under lmcadmin so you can enable urls like /admin/users or /admin/roles/permissions.

Add child route

To register a route as child route, the following example takes the option you name the route users. The complete path should look like /admin/users, so users is a literal route with the route value /users. Say you want this route to connect to the MyAdminModule\Controller\UsersController controller and the index action, create this config in your module.config.php:

-
'router' => [
'routes' => [
'lmcadmin' => [
'child_routes' => [
'users' => [
'type' => 'literal',
'options' => [
'route' => '/users',
'defaults' => [
'controller' => 'MyAdminModule\Controller\UsersController::class',
'action' => 'index',
],
],
],
],
],
],
],
+
'router' => [
'routes' => [
'lmcadmin' => [
'child_routes' => [
'users' => [
'type' => Laminas\Router\Http\Literal::class,
'options' => [
'route' => '/users',
'defaults' => [
'controller' => MyAdminModule\Controller\UsersController::class,
'action' => 'index',
],
],
],
],
],
],
],

Change the /admin url

If you want your admin interface at /backend or something else, you must override the value of the route. In the following config, the /admin route value is replaced with /backend. Make sure this is enabled in a config where the @@ -25,13 +25,13 @@

Change
'router' => [
'routes' => [
'lmcadmin' => [
'options' => [
'route' => '/backend',
],
],
],

Change the controller behind /admin

By default, the /admin url links to the LmcAdmin\Controller\AdminController controller. -It's an empty action and a simple view script is rendered. +LmcAdmin\Controller\AdminController is an simple action that only returns a simple view script. If you want, for example, to create a dashboard on the admin index page, you probably need to point the route to another controller. In the following config, the lmcadmin route's controller is replaced with MyAdminModule/Controller/AdminController and the action is set to dashboard. Make sure this is enabled in a config where the module is registered later LmcAdmin (otherwise, the config will not overwrite LmcAdmin's configuration):

-
'router' => [
'routes' => [
'lmcadmin' => [
'options' => [
'defaults' => [
'controller' => 'MyModule/Controller/AdminController',
'action' => 'dashboard',
],
],
],
],
],
+
'router' => [
'routes' => [
'lmcadmin' => [
'options' => [
'defaults' => [
'controller' => MyModule\Controller\AdminController::class,
'action' => 'dashboard',
],
],
],
],
],
\ No newline at end of file diff --git a/docs/next/Upgrading/to-v2.html b/docs/next/Upgrading/to-v2.html index 4a97544..3b51f2d 100644 --- a/docs/next/Upgrading/to-v2.html +++ b/docs/next/Upgrading/to-v2.html @@ -5,11 +5,11 @@ Upgrading from v1 to v2 | LmcAdmin - + -
Version: Next

Upgrading from v1 to v2

+
Version: Next

Upgrading from v1 to v2

LmcAdmin v2 is a major version upgrade with many breaking changes that prevent straightforward upgrading.

Namespace change

@@ -19,6 +19,6 @@

Namespace c

Default layout template name

The default layout template has been changed from layout/admin to layout/lmcadmin.

Configuration key

-

The configuration key for LmcAdmin was changed from lmcadmin to lmc_admin.

+

The configuration key for LmcAdmin was changed from lmcadmin to lmc_admin.

\ No newline at end of file diff --git a/docs/next/ViewLayout.html b/docs/next/ViewLayout.html index d80ea41..f21aa64 100644 --- a/docs/next/ViewLayout.html +++ b/docs/next/ViewLayout.html @@ -3,43 +3,43 @@ -View & Layout | LmcAdmin +Views & Layouts | LmcAdmin - + -
Version: Next

View and layout scripts

-

LmcAdmin includes an admin layout and index view script, so LmcAdmin works out of the box. These view scripts are fully -customizable, you can turn them off or render other scripts. +

Version: Next

View and layout templates

+

LmcAdmin includes an admin layout template and an index view template, such that LmcAdmin works out of the box. These view templates are fully +customizable, you can turn them off or render other templates. All options are listed below.

-

Use the applications's default layout

+

Use the applications's default layout template

You can disable LmcAdmin from using its own layout via configuration and the application's default layout will be used. -The routing and navigation still works, but the applicaiton's default layout script will be used.

+The routing and navigation still works, but the application's default layout template will be used.

You can modify the configuration to disable the usage of LmcAdmin layout.

In config/autoload/lmcadmin.global.php:

return [
'lmc_admin' => [
'use_admin_layout' => false
],
];
-

Override the LmcAdmin layout

-

You can provide your own admin layout script.

-

First create a layout view script in your application and define the View Manager template map to list -your custom layout script. Then modify the LmcAdmin configuration to define the layout that LmcAdmin will use:

+

Override the LmcAdmin layout template

+

You can provide your own admin layout template.

+

First create a layout view template in your application and define the View Manager template map to list +your custom layout template. Then modify the LmcAdmin configuration to define the layout that LmcAdmin will use:

In config/autoload/lmcadmin.global.php:

return [
'lmc_admin' => [
'admin_layout_template' => 'myapp/myadminlayout',
],
];

And in your module config:

-
return [
'view_manager' => [
'template_map' => [
'myapp/myadminlayout' => '/path/to/your/layout/template/script'
],
],
];
-

Override the view script for the AdminController index action

-

You can also define the script rendered when you visit /admin which defaults to AdminController::indexAction()

+
return [
'view_manager' => [
'template_map' => [
'myapp/myadminlayout' => '/path/to/your/layout/template'
],
],
];
+

Override the view template for the AdminController index action

+

You can also define the template rendered when you visit /admin which defaults to AdminController::indexAction()

AdminController::indexAction() will return a View Model using the template lmc-admin/admin/index.

Therefore, you can override the template via the View Manager template map.

In your module config:

-
return [
'view_manager' => [
'template_map' => [
'lmc-admin/admin/index' => '/path/to/your/template/script'
],
],
];
+
return [
'view_manager' => [
'template_map' => [
'lmc-admin/admin/index' => '/path/to/your/template'
],
],
];

Make sure your module is registered in the modules.config.php after LmcAdmin to override LmcAdmin configuration.

Disable layout

-

If you need a page within an admin controller where only the view script is rendered, +

If you need a page within an admin controller where only the view template is rendered, you can disable the layout. Layout disabling works just like any other page outside LmcAdmin where you disable the layout. -To accomplish this, you must terminate the view model in your controller:

-
class MyAdminController extends AbstractActionController
{
public function indexAction()
{
$model = new ViewModel;
$model->setTerminal(true);
return $model;
}
}
+To accomplish this, you must set the view model to 'terminal' in your controller:

+
class MyAdminController extends AbstractActionController
{
public function someAction()
{
$model = new ViewModel;
$model->setTerminal(true);
return $model;
}
}
\ No newline at end of file diff --git a/index.html b/index.html index c9c74ab..5cc09f5 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ Hello from LmcAdmin | LmcAdmin - + diff --git a/markdown-page.html b/markdown-page.html index fe23704..0ba68ab 100644 --- a/markdown-page.html +++ b/markdown-page.html @@ -5,7 +5,7 @@ Markdown page example | LmcAdmin - +