Skip to content

Commit

Permalink
Check theme property only for View instance and return early.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Aug 30, 2015
1 parent 07b03cf commit ac18728
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/View/CellTrait.php
Expand Up @@ -109,21 +109,25 @@ protected function _createCell($className, $action, $plugin, $options)
if (!empty($plugin)) {
$builder->plugin($plugin);
}
if (!empty($this->theme)) {
$builder->theme($this->theme);
}
if (!empty($this->helpers)) {
$builder->helpers($this->helpers);
$instance->helpers = $this->helpers;
}
if (isset($this->viewClass)) {
$builder->className($this->viewClass);
$instance->viewClass = $this->viewClass;
}

if ($this instanceof View) {
if (!empty($this->theme)) {
$builder->theme($this->theme);
}

$class = get_class($this);
$builder->className($class);
$instance->viewClass = $class;
return $instance;
}

if (isset($this->viewClass)) {
$builder->className($this->viewClass);
$instance->viewClass = $this->viewClass;
}
return $instance;
}
Expand Down

0 comments on commit ac18728

Please sign in to comment.