Jump to content

Archived

This topic is now archived and is closed to further replies.

littlevisuals

ZEND: Strict Standards, Creating default object from empty value?

Recommended Posts

Hi everyone im am currently getting the following error

 

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

 

<?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

 

   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:

 

 

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.