for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Nayjest\Grids\Components\Base;
trait TComponentView
{
use TRenderable {
TRenderable::getTemplate as private getTemplateInternal;
}
protected $render_section;
/**
* Returns variables for usage inside view template.
*
* @return array
*/
protected function getViewData()
return $this->grid->getViewData() + [
grid
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
'component' => $this
];
* Returns name of view template.
* @return string
public function getTemplate()
$grid_tpl = $this->grid->getConfig()->getTemplate();
return str_replace('*.',"$grid_tpl.", $this->template);
* Returns name of section in parent component
* where this component must be rendered.
* @return string|null
public function getRenderSection()
return $this->render_section;
* Sets name of section in parent component
* @param string|null $sectionName
* @return $this
public function setRenderSection($sectionName)
$this->render_section = $sectionName;
return $this;
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: