0

First of all, sorry my english isnt so good. So i have a problem, when i display my variable, he return me NULL and i dont know why :(

Label.php

class Services_Label extends Services_Abstract
{
    public function getlibelle()
    {
        $sRequest = 'SELECT NAME FROM menu WHERE id_application = 2';
        $this->executeQueries($sRequest);
        $aResult = $this->getAllRows();
        $this->freeStatement();
        return $aResult;
    }
}

IndexController.php

public function indexAction()
{
    $oMessage = new Services_Label();
    $toto = $oMessage->getlibelle();
    $this->view->newMenu12 = $toto;

    foreach ($toto as $data) {
        foreach($data as $key => $value) {
            echo $value[2] . '<br>';
        }
    }

Layout.php

<?php
echo $this->partial('/common/header.phtml', array(
    'notshowlogout' => (isset($this->notshowlogout) ? true : false),
    'profils' => $this->profils,
    'listeHabiUti' => $this->listeHabiUti,
    'libmenu' => $this->libmenu,
    'userName' => $this->userName,
    'siteName' => $this->siteName,
    'envName' => $this->envName,
    'newMenu12' => $this->newMenu12,
));
?>    

header.php

<?php var_dump($this->newMenu12); ?>

Answer : NULL

Vaios P.
  • 404
  • 8
  • 23
Nico
  • 177
  • 1
  • 11

0 Answers0