Download the PHP package mh/page-bundle without Composer
On this page you can find all versions of the php package mh/page-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package page-bundle
PRODUCTION VERSION
Config file
knp
knp_paginator: page_range: 5 default_options: page_name: page sort_field_name: sort sort_direction_name: direction distinct: true filter_field_name: filterField filter_value_name: filterValue template: pagination: '@KnpPaginator/Pagination/twitter_bootstrap_v4_pagination.html.twig' sortable: '@KnpPaginator/Pagination/sortable_link.html.twig' filtration: '@KnpPaginator/Pagination/filtration.html.twig'
twig
add this to your twig config, so we have a global configuration service
twig: globals: config: '@Mh\PageBundle\Helper\TwigHelper'
security
/config/packages/securty.yaml
security: encoders: Mh\PageBundle\Entity\User: algorithm: auto providers: app_userprovider: entity: class: Mh\PageBundle\Entity\User property: email firewalls: dev: pattern: ^/((profiler|wdt)|css|images|js)/ security: false main: anonymous: true guard: authenticators:
- Mh\PageBundle\Security\AppCustomAuthenticator
logout:
path: mh_page_app_logout
access_control:
- { path: ^/admin, roles: ROLE_ADMIN }
- { path: ^/profile, roles: ROLE_USER }
routes
/config/routes.yaml
mh_page: resource: '@MhPageBundle/Resources/config/routes.yaml'
install demo
app/bin app:install
change the redirect after login
we redirect to the route mh_page_login_home, just override that
template base.html.twig
{% extends "@MhPage/base.html.twig" %}
template layout.html.twig
{% extends "@MhPage/layout.html.twig" %}
promote user to admin
./bin/console app:promote EMAIL
neat features
Copy clipboard, make a:
and on your element
click
Remember
Assets
./bin/console assets:install --symlink
Extend admin menu
If you need to add more admin items, make a subscriber with
make:subscriber for the request
use Mh\PageBundle\Helper\SiteHelper;
class RequestSubscriber implements EventSubscriberInterface { private $siteHelper;
public function __construct(SiteHelper $siteHelper)
{
$this->siteHelper = $siteHelper;
}
public function onRequestEvent(RequestEvent $event)
{
if (!$event->isMasterRequest()) return;
$item = [
'url' => 'profile_dashboard',
'name' => 'Min profil',
];
$this->siteHelper->addAdminItem($item, 5);
}
}
Sitemap
If you need to add more sitemaps, copy the Mh\PageBundle\Command\SitemapCommand
DEV VERSION
Config file
routes
/config/routes.yaml
mh_page: resource: '../src/Controller' name_prefix: mhpage
mh_page_wildcard: path: /{page} methods: [GET] controller: Mh\PageBundle\Controller\MainController::page name_prefix: mhpage
maker
/config/packages/maker.yaml
maker: root_namespace: Mh\PageBundle
doctrine
/config/packages/doctrine.yaml
doctrine: orm: mappings: MhPageBundle: is_bundle: false type: annotation dir: '%kernel.project_dir%/src/Entity' prefix: 'Mh\PageBundle\Entity' alias: 'MhPageBundle'
All versions of page-bundle with dependencies
michelf/php-markdown Version ^1.9
knplabs/knp-paginator-bundle Version ^5.0
mh/collection Version ^1.0