<?php

namespace frontend\modules\forms;

/**
 * Class DynamicModel
 *
 * @package artbox\core\forms
 */
class DynamicModel extends \yii\base\DynamicModel
{
	/**
	 * @var mixed
	 */
	protected $_labels;

	/**
	 * @param $labels
	 */
	public function setAttributeLabels($labels)
	{
		$this->_labels = $labels;
	}

	/**
	 * @param string $name
	 *
	 * @return string
	 */
	public function getAttributeLabel($name)
	{
		return $this->_labels[$name] ?? $name;
	}
}