Social Icons

twitterfacebookgoogle pluslinkedinemail
Showing posts with label Joomla. Show all posts
Showing posts with label Joomla. Show all posts

Wednesday, 12 June 2013

Check user is login or not(Authentication) in joomla


you can check if user is login or not in joomla.
$user = JFactory::getUser();

if ($user->get('guest') == 1)
{
       echo “Not login”;
}
Else
{
   Echo “Loged user”;
}

use of session in joomla


use of session in joomla check following example

**********************
define session in joomla
**********************
$session = JFactory::getSession();

set session variable in joomla
---------------------------------
$session->set(‘name’,value); //set session

get session variable which set before in joomla
---------------------------------
$session->get(‘name’,value); // get session       

Hierarchy of Joomla component


You can see this example for Hierarchy of joomla component structure.
Example:
->com_gallary
                ->create Entry file same as component name like gallery.Php (Not optional)
                ->create Controller file like controller.php (Not optional)
                ->create models folder(optional if need model)(Create multiple models)
                                ->create model file  which name is same as controller name like gallery.php
                                   u can create multiple model in this folder with Controller name

 

Free Advertisement

Free Advertisement

Free Advertisement

Free Advertisement