@param string $name
@param array $data

@return $this
553323
public function view(string $name, array $data = [])
    {
        return $this->add(View::create($name, $data));
    }
165579
public function initFromArray(array $data) {

        if (!empty($data['message'])) {
            return $this;
        }

        return $this->setTime($data[0])
            ->setLow($data[1])
            ->setHigh($data[2])
            ->setOpen($data[3])
            ->setClose($data[4])
            ->setVolume($data[5]);

    }
1321478
protected function setWithArrayData(array $data)
    {
        if (isset($data[0])) { // multiple rows
            foreach ($data as $row) {
                $this->set($row);
            }
        } else { // multiple values
            foreach ($data as $col => $val) {
                $this->set($col, $val);
            }
            $this->set_row++;
        }
        return $this;
    }
351745
static public function token($name=null, $data=null)
    {
        if (!is_null($name) && is_null($data) && (is_numeric($name) || is_array($name) || $name=='')) {
            $data = $name;
            $name = null;
        }
        
        return (new FormToken())->form($name, $data);
    }
694610
public function setData($data) 
	{
		if(is_array($data)) {
			$this->data = $data;
		}
		
		$args = func_get_args();
		$this->data[$args[0]] = $args[1];
		
		return $this;
	}
102848
public function setData(array $data)
    {
        if (isset($data['name'])) {
            $this->setName($data['name']);
        }

        if (isset($data['active'])) {
            $this->setActive($data['active']);
        }

        return $this;
    }
1221040
protected function _newInput(array $data, $name = null)
    {
        $options = array();
        foreach (array_keys($this->_inputProperties) as $key) {
            if (isset($data[$key])) {
                $options[$key] = $data[$key];
            }
        }
        $input = new Input($name, $options);

        if (isset($data['filters'])) {
            $this->_addFilters($input, $data['filters']);
        }

        if (isset($data['validation'])) {
            $this->_addValidators($input, $data['validation']);
        }
        return $input;
    }
1015834
public function make(string $name, array $data = [], \Closure $callback = null)
    {
        $this->setWidgetName($name);
        $this->data = $data;
        /*
         | If second param given as closure then we will
         | return callback
         */
        if (!is_null($callback) && $callback instanceof \Closure) {
            return $callback($this);
        }

        /*
         | return object
         */
        return $this->render();
    }
336383
final public function fromArray(Array $data): self
    {
        foreach ($data as $key => $value) {
            $method = 'set' . ucfirst($key);

            if (method_exists($this, $method)) {
                $this->$method($value);
            }
        }

        return $this;
    }
620836
public function createFromImportedData($name, $data)
    {
        $class = new GroupClass($name);
        foreach ($data as $parameterName => $parameterData) {
            $class->addParameter($this->getGroupParameterFactory()->createFromImportedData($parameterName, $parameterData));
        }
        return $class;
    }
759284
public function required($name, $data = null)
	{
		if (null === $data)
		{
			return isset($this->data[$name]);
		}
		else
		{
			return isset($data[$name]);
		}
	}
1248477
protected function view($name, array $data = [])
    {
        $name = is_null($this->viewNamespace) ? $name : "{$this->viewNamespace}::$name";

        return parent::view($name, $data);
    }
792581
public function initByData($data)
    {
        foreach ($data as $name => $value) {
            $this->set($name, $value);
        }
        $this->initialize();
        return $this;
    }
645897
public function layout($name, array $data = [])
    {
        $this->layoutName = $name;
        $this->layoutData = $data;
        $this->engine->getProject()->get('file_layout_cache')->merge([$this->file->getUid() => [$this->layoutName]]);
    }
1311643
protected function view($name, array $data = [])
    {
        $this->viewExistsOrFail($name);

        $this->data = array_merge($this->data, $data);

        $this->beforeViewRender();
        $view = $this->renderView($name);
        $this->afterViewRender();

        return $view;
    }
1193204
public function addFile($name, $data) {
        $file = new File($this->getChild($name));
        $file->write($data);
        return $file;
    }
1191646
public function save($name, array $data = [])
    {
        $table  = $this->_getTable();
        $entity = $table->findByName($name)->first();

        $newData = [
            'name'   => $name,
            'params' => $data
        ];

        if ($entity !== null && $entity->get('name') === $name) {
            $entity = $table->patchEntity($entity, $newData);
        } else {
            $entity = $table->newEntity($newData);
        }

        return $table->save($entity);
    }