$app = JFactory::getApplication();

$pageclass = $app->getParams()->get('pageclass_sfx', '');

 

$jinput = JFactory::getApplication()->input;

$option = $jinput->getCmd('option'); // This gets the component

$view = $jinput->getCmd('view'); // This gets the view

$layout = $jinput->getCmd('layout'); // This gets the view's layout

 

Protostar example: Use Fluid Layout for category menu items with Class ' liquid'

 

<div class="container<?php echo ($params->get('fluidContainer') ? '-fluid' : ''); ?><?php if( $pageclass == ' liquid' && $view == 'category' ) { echo '-fluid'; } ?>">