mh / page-bundle
Installs: 66
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Language:CSS
Type:symfony-bundle
Requires
- cocur/slugify: ^3.2
- knplabs/knp-paginator-bundle: ^5.0
- mh/collection: ^1.0
- michelf/php-markdown: ^1.9
Requires (Dev)
- symfony/var-dumper: ^5.0
- dev-master
- 5.0.0
- 1.2.49
- 1.2.48
- 1.2.47
- 1.2.46
- 1.2.45
- 1.2.44
- 1.2.43
- 1.2.42
- 1.2.41
- 1.2.40
- 1.2.39
- 1.2.38
- 1.2.37
- 1.2.36
- 1.2.35
- 1.2.34
- 1.2.33
- 1.2.32
- 1.2.31
- 1.2.30
- 1.2.29
- 1.2.28
- 1.2.27
- 1.2.26
- 1.2.25
- 1.2.24
- 1.2.23
- 1.2.22
- 1.2.21
- 1.2.20
- 1.2.19
- 1.2.18
- 1.2.17
- 1.2.16
- 1.2.15
- 1.2.14
- 1.2.13
- 1.2.12
- 1.2.11
- 1.2.10
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2
- 1.1
- 1.0
This package is auto-updated.
Last update: 2024-11-05 02:38:21 UTC
README
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_user_provider: 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
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: mh_page_
mh_page_wildcard: path: /{page} methods: [GET] controller: Mh\PageBundle\Controller\MainController::page name_prefix: mh_page_
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'