• 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

Smarty if isset

phpsmarty


PHP Snippet 1:

<?php 
$smarty->assign('logged_method',0); 
$smarty->assign('logged_method_2',0); 

if (isset($_SESSION['user']['id']))
{
     $smarty->assign('logged_method',1);  
}
if (Users::isuser())
{
     $smarty->assign('logged_method_2',1);

}
?>

PHP Snippet 2:

{if $logged_method eq 1} You are logged in using method 1 {/if}
{if $logged_method_2 eq 1} You are logged in using method 2 {/if}

Related Snippets

Magento Installation SQLSTATE[HY000] [2002] No such file or directory error

unable to load your default controller on Codeigniter

How can I get user id from session in javascript?

I want to use codeigniter foreign character library in my custom PHP project how i can use it?

how to insert data into select2 search input after scan using qrcode

Pass a select with mysqli_fetch_row to a table

Reload parent page after submit in iframe

How to MODIFY a Google Docs document via API using search-and-replace?

Laravel - Implicit route model binding with soft deleted data

Sort a multidimensional array by integer inside of a string value which is two levels down

WordPress + Nginx on non-standard port behind AWS ELB results in broken links

file_get_contents() without "Http" to access external URL [closed]

Laravel 5.1 xmlHttpRequest AJAX POST TokenMismatchException

How to validate tin and cst using PHP?

auth pages not getting css in laravel

About Contact Privacy policy Terms and conditions