SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2013
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Error arising in PHP Zend coding while displaying index page

    Hello Mentor ,

    I am a "NewB" in PHP and PHP Zend.
    I am making a program while watching video tutorial.
    Everything fine in video and i am also following the same instruction which r in video but i my coding an error has arised saying:

    Notice: Undefined variable: option in C:\xampp\htdocs\articlemanager\html\index.php on line 26

    I have pasted the code below for index.php file

    <?php
    /**
    * My new Zend Framework project
    *
    * @author Jon
    * @version 1.0
    */
    set_include_path('.'
    . PATH_SEPARATOR . get_include_path()
    . PATH_SEPARATOR . '../library'
    . PATH_SEPARATOR . '../application/classes/'
    . PATH_SEPARATOR . '../application/models/'

    );

    require_once 'Zend/Controller/Front.php';

    Zend_Loader::registerAutoload();

    $options = array(
    'layout' => 'layout',
    'layoutContent' => '../application/views/layouts/',
    'contentKey' => 'content' );

    new DbInitialize();
    Zend_Layout::startMvc($option); //This is line No. 26


    /**
    * Setup controller
    */
    $controller = Zend_Controller_Front::getInstance();
    $controller->setControllerDirectory('../application/controllers');
    //$controller->throwExceptions(true); // should be turned on in development time

    // run!
    $controller->dispatch();


    wat to do to remove the error and also the website is getting displayed without any CSS

    Any help will be appriciated
    Thanks in advance
    Abha

  2. #2
    SitePoint Wizard lorenw's Avatar
    Join Date
    Feb 2005
    Location
    was rainy Oregon now sunny Florida
    Posts
    1,100
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    you are declaring $options as an array but on line 26 you have $option that has not been defined or set
    What I lack in acuracy I make up for in misteaks


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •