jumpersoft / symfony-base-bundle
Symfony base bundle, contains general classes, controls and templates.
Requires
- beberlei/doctrineextensions: ^1.3
- doctrine/doctrine-migrations-bundle: ^3.0
- exercise/htmlpurifier-bundle: ^2.0
- lexik/jwt-authentication-bundle: ^2.12
- nelmio/cors-bundle: ^2.1
- sendgrid/sendgrid: ^7.2
- symfony/google-mailer: 5.4.*
- symfony/mailer: 5.4.*
- twig/twig: ^2.12|^3.0
- dev-master
- 3.0.1
- 3.0.0
- 2.5.7
- 2.5.6
- 2.5.5
- 2.5.4
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.3
- 2.4.2
- 2.4.1
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.10
- 2.2.9
- 2.2.8
- 2.2.7
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.1
- 2.0.0
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.60
- 1.0.59
- 1.0.58
- 1.0.57
- 1.0.56
- 1.0.55
- 1.0.54
- 1.0.53
- 1.0.52
- 1.0.51
- 1.0.50
- 1.0.49
- 1.0.48
- 1.0.47
- 1.0.46
- 1.0.45
- 1.0.44
- 1.0.43
- 1.0.42
- 1.0.41
- 1.0.40
- 1.0.39
- 1.0.38
- 1.0.37
- 1.0.36
- 1.0.35
- 1.0.34
- 1.0.33
- 1.0.32
- 1.0.31
- 1.0.30
- 1.0.29
- 1.0.28
- 1.0.27
- 1.0.26
- 1.0.25
- 1.0.24
- 1.0.23
- 1.0.22
- 1.0.21
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2024-11-15 02:13:36 UTC
README
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require jumpersoft/symfony-base-bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:
<?php
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new Jumpersoft\BaseBundle\JumpersoftBaseBundle(),
);
// ...
}
// ...
}
Step 3: Configure Bundle
In "app/config/parameters.yml" and "..parameters.yml.dist" set configuration with:
Base parameters, put all parameters with values optional by each utility:
# Secrete api captcha key (like google recaptcha) jumpersoft.recaptcha.secretCaptchaKey: ''
# For authentication utility, e.g. 'MyBundleBundle:User' or 'JumpersoftEcommerceBundle:User' jumpersoft.entityUser: ''
# Route to redirect if authentication failure jumpersoft.redirectToOnAuthenticationFailure: ''
# Default store id to for use with JumpersoftEcommerceBundle jscommerce.defaultStoreId: ''
# Email to use for no reply notifications mailer_email_no_reply: 'info@jumpersoft.com'
# Email to use for use with JumpersoftEcommerceBundle notifications mailer_email_intern_for_notifications: 'webadmin@jumpersoft.com'
Service parameters, add this configuration in your services.yml main file:
services:
... _defaults: bind: $defaultStoreId: '%jscommerce.defaultStoreId%' $debug: '%kernel.debug%'
Security paramaters, you can change with your name:
jumpersoft.security.token_key: '' # csrf token jumpersoft.security.jwt_private_key_path: '' # ssh path private key path jumpersoft.security.jwt_public_key_path: '' # ssh path public key path jumpersoft.security.jwt_key_pass_phrase: '' # ssh key pass phrase jumpersoft.security.jwt_token_ttl: 86400 # jwt duration
In "app/config/config.yml" set the next lexic jwt authentication configuration:
Add configuration below to use for with the listener Exception:
framework:
... templating: engines: ['twig']
Optional, add configuration below to add a shorcut to access to entities in DQL
doctrine: ...
orm: .. mappings: MainEntities: type: annotation # Changue to your bundle name dir: '%kernel.project_dir%/src/AppBundle/Entity' prefix: AppBundle\Entity alias: E
Add Lexit JWT Athentication configurarion:
lexik_jwt_authentication:
private_key_path: %jumpersoft.security.jwt_private_key_path% public_key_path: %jumpersoft.security.jwt_public_key_path% pass_phrase: %jumpersoft.security.jwt_key_pass_phrase% token_ttl: %jumpersoft.security.jwt_token_ttl%
Step 4: Use the Bundle
This are the topics related to this bundle:
Templates:
- Controls: input controls like text, combo, radio and other inputs more complex related to jquery and bootstratp controls like select2, datetimepicker etc.
- Forms: generic forms like user login, user signup, address, and others.
Classes:
- JumpersoftBaseController: extend of Controller symfony class for multiple purpose.
- JwtAuthenticator: class for authentication and authorization use "GuardAuthenticator".
Extensions:
- JumpersoftMailerExtension: extend of Mailer for multiples purpose.
- JumpersoftMapArrayExtension: functions to map arrays from json request, to validate agains class validators-regex and more.
- JumpersoftReCaptchaExtension: functions to handle captcha functions.
- JwtAuthenticator: Class to handle Json Web Token Authentication.
Annotations
- CsrfTokenValidation: Annotation to handle CSRF functions in controllers.
Twig extensions:
- JumpersoftBaseTwigExtension: generic functions to handle formated dates in "America/Mexico_City" timezone.
Doctrine extensions for MySQL:
- String functions: FORMAT
- DateTime functions: DATE_FORMAT
Step 5: Notes:
We recommend use the bundle "nelmio/cors-bundle": "~1.4" in order to take all advantages with json web tokens.