for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Apps\Model\Admin\Search;
use Ffcms\Core\Arch\Model;
/**
* Class FormSettings. Model to transfer and validate input data & attributes for search admin configs.
* @package Apps\Model\Admin\Search
*/
class FormSettings extends Model
{
public $itemPerApp;
public $minLength;
private $_configs;
* ForumSettings constructor. Construct model with default values
* @param array|null $configs
public function __construct(array $configs = null)
$this->_configs = $configs;
parent::__construct();
}
public function before()
if ($this->_configs === null) {
return;
foreach ($this->_configs as $property => $value) {
if (property_exists($this, $property)) {
$this->$property = $value;
* Labels for admin settings form
* @return array
public function labels(): array
return [
'itemPerApp' => __('Search count'),
'minLength' => __('Min length')
];
* Validation rules
* @return @array
@array
0
public function rules(): array
[['itemPerApp', 'minLength'], 'required'],
[['itemPerApp', 'minLength'], 'int']