source example

protected $index;

    /** * populate Source Object with meta data from Resource * * @param Smarty_Template_Source $source source object * @param Smarty_Internal_Template $_template template object */
    public function populate(Smarty_Template_Source $source, ?Smarty_Internal_Template $_template = null)
    {
        $filePath = $this->buildFilepath($source$_template);
        $s = Smarty_Resource::source(null, $source->smarty, $filePath);

        $source->components = $s;
        $source->filepath = $s->filepath;
        $source->uid = $s->uid;
        if ($_template && $_template->smarty->compile_check) {
            $source->timestamp = $s->timestamp;
            $source->exists = $s->exists;
        }
        $source->template = $_template;
    }

    
class ClickSendOptionsTest extends TestCase
{
    public function testClickSendOptions()
    {
        $clickSendOptions = (new ClickSendOptions())
            ->country('test_country')
            ->customString('test_custom_string')
            ->fromEmail('test_from_email')
            ->listId('test_list_id')
            ->schedule(999)
            ->source('test_source');

        self::assertSame([
            'country' => 'test_country',
            'custom_string' => 'test_custom_string',
            'from_email' => 'test_from_email',
            'list_id' => 'test_list_id',
            'schedule' => 999,
            'source' => 'test_source',
        ]$clickSendOptions->toArray());
    }
}
if ($_file_to_check[2] == 'file' || $_file_to_check[2] == 'php') {
                    if ($this->source->filepath == $_file_to_check[0] && isset($this->source->timestamp)) {
                        // do not recheck current template                         $mtime = $this->source->timestamp;
                    } else {
                        // file and php types can be checked without loading the respective resource handlers                         $mtime = @filemtime($_file_to_check[0]);
                    }
                } elseif ($_file_to_check[2] == 'string') {
                    continue;
                } else {
                    $source = Smarty_Resource::source(null, $this->smarty, $_file_to_check[0]);
                    $mtime = $source->timestamp;
                }
                if (!$mtime || $mtime > $_file_to_check[1]) {
                    $is_valid = false;
                    break;
                }
            }
        }
        if ($cache) {
            $this->cached->valid = $is_valid;
        } else {
            


use Symfony\Config\AddToListConfig;

return static function DAddToListConfig $config) {
    $config->translator()->fallbacks(['sv', 'fr', 'es']);
    $config->translator()->source('\\Acme\\Foo', 'yellow');
    $config->translator()->source('\\Acme\\Bar', 'green');

    $config->messenger([
        'routing' => [
            'Foo\\MyArrayMessage' => [
                'senders' => ['workqueue'],
            ],
        ],
    ]);
    $config->messenger()
        ->routing('Foo\\Message')->senders(['workqueue']);
    

    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
    {
        $uid = '';
        $sources = array();
        $components = explode('|', $source->name);
        $exists = true;
        foreach ($components as $component) {
            $s = Smarty_Resource::source(null, $source->smarty, $component);
            if ($s->type == 'php') {
                throw new SmartyException("Resource type {$s->type} cannot be used with the extends resource type");
            }
            $sources[$s->uid] = $s;
            $uid .= $s->filepath;
            if ($_template && $_template->smarty->compile_check) {
                $exists = $exists && $s->exists;
            }
        }
        $source->components = $sources;
        $source->filepath = $s->filepath;
        
Home | Imprint | This part of the site doesn't use cookies.