Table View Generator

@param String $type
@return View
497083
public function table($type = null)
    {
        $this->breadcrumb->onTable($type);
        return $this->datatables->render('antares/notifications::admin.index.index');
    }
244147
private function renderRowArray($type = 'normal')
    {
        $data = $this->getTable()->getData();
        $headers = $this->getTable()->getHeaders();
        $render = array();

        foreach ($data as $rowData) {
            $this->setActualRow($rowData);
            $temp = array();
            foreach ($headers as $name => $options) {
                if ($type == 'assc') {
                    $temp[$name] =  $this->getTable()->getHeader($name)->getCell()->render('array');
                } else {
                    $temp[] =  $this->getTable()->getHeader($name)->getCell()->render('array');
                }
            }
            $render[] = $temp;
        }
        return $render;
    }
604257
protected function _render($type) {
		// @todo Replace the `AssetCompress` check by a `Reveal` rule.
		if (in_array($type, array('js', 'css')) && CakePlugin::loaded('AssetCompress') && isset($this->_View->AssetCompress)) {
			foreach ($this->{$type} as $path => $args) {
				$targets = $this->_View->AssetCompress->config()->targets($type);
				$exists = false;
				foreach ($targets as $target) {
					$files = $this->_View->AssetCompress->config()->files($target);
					if (in_array($this->_addExt($path, $type), $files) || in_array($path, $files)) {
						$exists = true;
						break;
					}
				}
				$args = array_merge(Hash::normalize(array('path', 'rel', 'options')), compact('path') + $args);

				if (!$exists) {
					if ('js' == $type) {
						$this->_View->Html->script($path, (array) $args['options']);
					} else {
						$this->_View->Html->css($path, $args['rel'], (array) $args['options']);
					}
					continue;
				}

				$haystack = $this->_View->fetch($args['options']['block']);
				$target = str_replace(array('.css', '.js'), array('', ''), $target);
				$needle = DS . 'assets' . DS . $target;
				if (strpos($haystack, $needle) === false) {
					$method = $type;
					if ('js' == $method) {
						$method = 'script';
					}
					$this->_View->AssetCompress->{$method}($target, (array) $args['options']);
				}
			}
			return;
		}

		foreach ($this->{$type} as $path => $args) {
			extract($args);

			switch ($type) {

				case 'css':
					if (!isset($haystack)) {
						$haystack = $this->_View->fetch('css');
					}

					$needle = $this->_View->Html->css($path, $rel, $options);
					if (strpos($haystack, $needle) === false) {
						$this->_View->prepend('css', $needle);
					}
				break;

				case 'js':
					$this->_View->Html->script($path, $options);
				break;

				case 'scriptBlock':
					$this->_View->Html->scriptBlock($script, $options);
				break;

				default:
			}

		}
	}
1099332
public function getGeneratorMethod($type)
    {
        switch ($type) {
            case in_array($type, $this->inputGroups['hidden']):
                return 'makeHidden';

            case in_array($type, $this->inputGroups['text']):
                return 'makeText';

            case in_array($type, $this->inputGroups['select']):
                return 'makeSelected';

            case in_array($type, $this->inputGroups['checkbox']):
                return 'makeCheckbox';

            case in_array($type, $this->inputGroups['radio']):
                return 'makeRadio';

            case in_array($type, $this->inputGroups['relationship']):
                return 'makeRelationship';

            default:
                return 'makeHTMLInputString';
        }
    }
599450
private function parseRow($line, $type): ?TableRow
    {
        if (strpos($line, '|') === false) {
            return null;
        }

        $row = new TableRow();
        foreach (explode('|', $line) as $cell) {
            // Strip leading ".b." from <th> cells
            if ($type === TableCell::TYPE_HEAD && substr_compare($cell, '.b.', 0)) {
                $cell = substr($cell, 3);
            }
            $row->appendChild(new TableCell($cell, $type, null));
        }

        return $row;
    }
1107983
public function getHtml($type = self::NO_SINGLE_RENDER_TYPE) {
        $this->_singleRenderType = $type;
        return $this->_handleDirectCall('getHtml')->toHtml();
    }
338767
public function renderFields($type, $fields = [])
    {
        if (empty($fields)) {
            $fields = $this->getFields();
        }
        $output = '';

        switch ($type) {
        case 'form-create':
            $output .= $this->fieldHelper->formCreate($fields);
            break;
        case 'form-edit':
            $output .= $this->fieldHelper->formEdit($fields);
            break;
        case 'table-headings':
            $output .= $this->fieldHelper->tableHeadings($fields);
            break;
        case 'table-content':
            $output .= $this->fieldHelper->tableContent($fields, $this->instance);
            break;
            // JavaScript Variables
        case 'js-var':
            foreach ($fields as $f) {
                $output .= 'var '.$f.' = '.$this->instance->$f.'; ';
            }
            break;
        case 'js-modal-create':
            foreach ($fields as $f) {
                $output .= '"'.$f.'": $(\'#createItem'.$f.'\').val(), ';
            }
            break;
        default:
            break;
        }

        echo $output;
    }
1057382
protected function viewContent($type, $view)
    {
        $ext = pathinfo($view, PATHINFO_EXTENSION);
        $view = ($ext === '') ? $view.'.php' : $view;
        foreach ($this->paths as $path) {
            $path .= $type . DIRECTORY_SEPARATOR;
            if ($this->context()
                &&
                file_exists($path . trim($this->context(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $view)
            ) {
                $viewPath = $path . trim($this->context(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $view;
                break;
            }
            if (file_exists($path . $view)) {
                $viewPath = $path . $view;
                break;
            }
        }
        if (!isset($viewPath)) {
            throw new \RuntimeException('Unable to find the ' . $view);
        }
        ob_start();
        include($viewPath);
        $content = ob_get_contents();
        ob_end_clean();
        return $content;
    }
290983
public function flip(String $type = 'both') : GD
    {
        imageflip($this->canvas, Helper::toConstant($type, 'IMG_FLIP_'));

        return $this;
    }
967613
protected function _render_frame($type, $frame) {

    if ( !isset($this->_renderers[$type]) ) {
      
      switch ($type) {
      case "block":
        $this->_renderers[$type] = new Block_Renderer($this->_dompdf);
        break;

      case "inline":
        $this->_renderers[$type] = new Inline_Renderer($this->_dompdf);
        break;

      case "text":
        $this->_renderers[$type] = new Text_Renderer($this->_dompdf);
        break;

      case "image":
        $this->_renderers[$type] = new Image_Renderer($this->_dompdf);
        break;
      
      case "table-cell":
        $this->_renderers[$type] = new Table_Cell_Renderer($this->_dompdf);
        break;
      
      case "table-row-group":
        $this->_renderers[$type] = new Table_Row_Group_Renderer($this->_dompdf);
        break;

      case "list-bullet":
        $this->_renderers[$type] = new List_Bullet_Renderer($this->_dompdf);
        break;

      case "php":
        $this->_renderers[$type] = new PHP_Evaluator($this->_canvas);
        break;

      case "javascript":
        $this->_renderers[$type] = new Javascript_Embedder($this->_dompdf);
        break;
        
      }
    }
    
    $this->_renderers[$type]->render($frame);

  }
271191
private function getIdGenerator($type)
    {
        if (!isset($this->idGenerators[$type])) {
            $this->idGenerators[$type] = IdGenerator::create($type);
        }

        return $this->idGenerators[$type];
    }
349928
protected function getBasicTemplate(string $type) : string
    {
        $view = $this->config->getView();
        $result = $view->Form->control('{{name}}', [
            'value' => '{{value}}',
            'type' => $type,
            'label' => false
        ]);

        return $result;
    }
888658
public function render($type = 'all') {
		if ('all' != $type) {
			return $this->_render($type);
		}

		$out = '';
		foreach (array('js', 'scriptBlock', 'css') as $type) {
			$out .= $this->_render($type);
		}

		return $out;
	}
297873
public static function view($type, $view)
    {
        if ($view !== null && View::exists($view) === false) {
            throw new Exception($view . ' view is not found', 2);
        }

        $callRender = array( '\\' . get_called_class(), 'render' . ucfirst($type) );

        switch ($type) {
            case 'error':
                self::$views[$type] = $view;
                App::on('error', $callRender);

                if (empty(self::$displayErrors)) {
                    self::$displayErrors = ini_get('display_errors');

                    function_exists('ini_set') && ini_set('display_errors', '0');
                }
                break;

            case 'classes':
            case 'performance':
                self::$views[$type] = $view;
                App::on('terminate', $callRender);
                break;

            case 'before':
                self::$views[$type] = $view;
                break;

            default:
                throw new Exception($type . ' is not valid event', 2);
        }
    }
645760
public function actionList($type)
    {
        $view = $this->createView('list', $type);
        $fields = (new \Stack\Setting)
            ->parse('BackOffice')
            ->get('list.' . $type);
        if (empty($fields)) {
            $fields = ['name()'];
        }
        $view['fields'] = $fields;
        $view['models'] = $this->getNewEntity($type)->fetchAll();
        return $view;
    }
1367409
protected function createBuilder(ResolvedType $type, array $options)
    {
        $builder = new TableBuilder($type, $this, $options);
        $extensions = $this->getExtensionsForType($type);

        // Extensions build pass
        foreach ($extensions as $extension) {
            $extension->buildTable($builder, $options);
        }

        // And build the fields
        $type->buildTable($builder, $options);

        // Extensions build pass
        foreach ($extensions as $extension) {
            $extension->finishTable($builder, $options);
        }

        return $builder;
    }
50030
public function create(string $type) : ?Controller
    {
        if (\class_exists($type) === false) {
            return $this->fallthrough($type);
        }

        $ref = new \ReflectionClass($type);
        $ctor = $ref->getConstructor();
        if ($ctor === null || $ctor->getNumberOfParameters() === 0) {
            return new $type();
        }

        return $this->fallthrough($type);
    }