PHP code example of mmelcor / yii2-babelfish

1. Go to this page and download the library: Download mmelcor/yii2-babelfish library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mmelcor / yii2-babelfish example snippets


'components' => [
	'awss3Fs' => [
		'class' => 'creocoder\flysystem\AwsS3Filesystem',
		'key' => '[AWS key]',
		'secret' => '[AWS Secret]',
		'region' => '[region]',
		'bucket' => '[bucket name]',
		'prefix' => '[prefix folder path]',
		'baseUrl' => '[S3 base url path]'
	],
	'...',
],

'components' => [
	'...',
	'babelFileStorage' => [ //this must be the component name, as it is being used in the module.
		'class' => 'trntv\filekit\Storage',
		'filesystemComponent' => 'awss3Fs', //or whichever file system you are using.
		'baseUrl' => '[Your base url path]'
	],
	'...',
],

	'components' => [
		'. . .',
		'babelfishDb' => [
			'class' => 'yii\db\Connection',
			'dsn' => 'mysql:host=localhost;dbname=[database name],
			'username' => '[username]',
			'password' => '[password]',
			'charset' => 'utf8',
		],
	],
	

	    'bootstrap' => ['log', 'babelfish-init'],
		'modules' => [
			'babelfish-init' => 'mmelcor\babelfish\Init',
		],
	

	
	'modules' => [
		'babel' => [
			'class' => 'mmelcor\babelfish\Module',
			'cookieValidationKey' => '[CSRF Key]', //you will need to generate a unique validation key.
		],
	],
	

'i18n' => [
	'translations' => [
		'. . .',
		'base*' => [
			'class' => 'yii\i18n\GettextMessageSource',
			'useMoFile' => false,
			'basePath' => '@common/messages',
		],
		'babelfish*' => [
			'class' => 'yii\i18n\GettextMessageSource',
			'useMoFile' => false,
			'basePath' => '@common/messages',
		],
	],
],
json
php composer.phar