Skip to content

Instantly share code, notes, and snippets.

@alfrekjv
Forked from dragoonis/gist:1254618
Created September 30, 2011 19:07
Show Gist options
  • Save alfrekjv/1254683 to your computer and use it in GitHub Desktop.
Save alfrekjv/1254683 to your computer and use it in GitHub Desktop.
function render($template, array $params = array(), array $options = array()) {
$session = $this->getSession();
if(!isset($params['isAjax']) && !$this->is('ajax')) {
if($this->isLoggedIn()) {
$params['nombre'] = $session->get('nombre');
}
}
parent::render($template, $params, $options);
}
@alfrekjv
Copy link
Author

function isLoggedIn() {

    if ( ! $this->getSession()->exists( "nivel" ) ) {
        return true;
    } else {
        return false;
    }
}

@dragoonis
Copy link

<?php
function isLoggedIn() {
    return $this->getSession()->exists('nivel');
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment