Author Topic: ZEND: Strict Standards, Creating default object from empty value?  (Read 2342 times)

0 Members and 1 Guest are viewing this topic.

Offline littlevisualsTopic starter

  • Enthusiast
  • Posts: 53
  • Gender: Male
  • Clever Girl...
    • View Profile
ZEND: Strict Standards, Creating default object from empty value?
« on: September 14, 2009, 07:19:50 PM »
Hi everyone im am currently getting the following error

Quote
Strict Standards: Creating default object from empty value in /Users/name/Sites/websiteX/application/controllers/ArtistsController.php on line 40

my layout is like this

-views/
         /scripts
                    /artists
                              /index.phtml
                    /index
                             /index.phtml

In the IndexController I have used the same code in the ArtistsController.  The path index/index works perfectly but the artists/index throws the error code.

Here is the Controller

Code: [Select]
<?php

/**
 * Description of ArtistsController
 *
 * @author 
 */
class ArtistsController extends Zend_Controller_Action {

   
/**
    * accessing our session variable
    * @var Zend_Session_Namespace
    */
   
protected $session;

   public function 
preDispatch()
   {
       
$this->session = new Zend_Session_Namespace('Default');



   }

   public function 
loadModel($class$module null)
    {
        
$modelDir $this->getFrontController()->getModuleDirectory($module)
                       . 
DIRECTORY_SEPARATOR 'models';
        
Zend_Loader::loadClass($class$modelDir);

        
// if we got here - then file is included
        
return $class;
    }



   public function 
init()
   {
        
$uri $this->_request->getPathInfo();
$activeNav $this->view->navigation()->findByUri($uri);
$activeNav->active true;
$activeNav->setClass("active");
      
   }

  public function 
indexAction()
   {


   }

It says line 40 is here

Code: [Select]
   public function init()
   {
        $uri = $this->_request->getPathInfo();
$activeNav = $this->view->navigation()->findByUri($uri);
$activeNav->active = true;
$activeNav->setClass("active");
     
   }

Which calls the navigation.xml file.  It works in the IndexController but not the ArtistsController?

Can anybody explain what im doing wrong?  many thanks!  :shy:

A lot of hacking is playing with other people, you know, getting them to do strange things.
Steve Wozniak