• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Can we define variables in `.tpl` files?

phpsmarty


PHP Snippet 1:

{assign var="foo" value="Foo"}
{assign "foo" "Foo"} {* short-hand *}

The value of $foo is Foo.

Related Snippets

Using spatie/media-library, how to rename a collection of uploaded files?

I want to display a sweetalert after the inserting of data in my database

PHP: Insert marker every 3 iterations

Merge column values from two arrays to form an indexed array of associative arrays

Laravel Get Days In Month From Month Number?

How to access a var with "-" in PHP [duplicate]

SQLSTATE[HY000]: General error: 1 table posts has no column named *

XAMPP keeps showing Dashboard/Welcome Page instead of the Configuration Page

Laravel 5.5 change unauthenticated login redirect url

Check for PDO Results, If None Display Message, If Yes then Loop Through

Fatal error: Uncaught mysqli_sql_exception: Unknown database 'test' in ... (How do I fix that? Using PHP)

Select option menu read from database and use it's values

PHP Startup: Unable to load dynamic library 'openssl' in Ubuntu

Performance of foreach, array_map with lambda and array_map with static function

Yii2 select2 database exception number of bound variables does not match number of tokens

About Contact Privacy policy Terms and conditions