public function buildVueTemplate($fileName, array $tokens)
{
$vueTemplateBuilder = new VueTemplates($tokens);
$commonTemplateBuilder = new CommonTemplates($tokens);
switch ($fileName) {
case 'create':
if ($this->hasChild($tokens) && $this->isViewChild($tokens)) {
return $commonTemplateBuilder->commonChildCreateTemplate();
}
return $commonTemplateBuilder->commonCreateTemplate();
case 'edit':
if ($this->hasChild($tokens) && $this->isViewChild($tokens)) {
return $commonTemplateBuilder->commonChildEditTemplate();
}
return $commonTemplateBuilder->commonEditTemplate();
case 'show':
if ($this->hasChild($tokens) && $this->isViewChild($tokens)) {
return $commonTemplateBuilder->commonChildShowTemplate();
}
return $commonTemplateBuilder->commonShowTemplate();
case 'index':
if ($this->hasChild($tokens) && $this->isViewChild($tokens)) {
if ($this->hasSlug($tokens)) {
return $vueTemplateBuilder->vueChildIndexSlugTemplate();
}
return $vueTemplateBuilder->vueChildIndexTemplate();
}
if ($this->hasSlug($tokens)) {
return $vueTemplateBuilder->vueIndexSlugTemplate();
}
return $vueTemplateBuilder->vueIndexTemplate();
default:
return 'filename not supported';
}
}