PHP code example of phact-cmf-modules / lang

1. Go to this page and download the library: Download phact-cmf-modules/lang 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/ */

    

phact-cmf-modules / lang example snippets


'lang' => [
    'class' => \Modules\Lang\Components\Lang::class,
    'langs' => ['ru', 'en'],
    'primaryLang' => 'ru'
],

...
'name' => [
    'class' => LangCharField::class,
    'label' => 'Name',
    'primaryNull' => true,
    'secondaryNull' => true
],
...

$nameField = $model->getField('name');
foreach ($nameField->getFieldsNames() as $name) {
    $model->{$name} = "";
}

$model->name