[Midas] controllers/IndexController.php

Mona Wong mona at sdsc.edu
Wed Jul 4 19:47:28 EDT 2012


	I'm still getting a blank page...

	Here is my controllers/IndexController.php:

<?php
class Example_IndexController extends Example_AppController
{
  /**
   * @method initAction()
   *  Index Action (first action when we access the application)
   */
  function init()
    {

    } // end method indexAction

  /** index action*/
  function indexAction()
    {
        //$this->disableLayout();
        //$this->disableView();
        $this->view->mona = "MONA";
    }

}//end class

	Here is my views/index/index.phtml (taken from midas/modules/batchmake/views/index/index.phtml):

<?php
$this->headScript()->appendFile($this->coreWebroot . '/public/js/jquery/jquery.form.js');
$this->headScript()->appendFile($this->apiWebroot.'/public/js/common/common.ajaxapi.js');
?>
<link type="text/css" rel="stylesheet" href="<?php echo $this->coreWebroot?>/public/css/common/common.genericPage.css" />
<div class="viewMain">
<h2>Welcome to the Annio Plugin</h2>
</div>

	Do you spot a problem?

Mona


On Jul 4, 2012, at 1:23 PM, Michael Grauer wrote:

> This is also related to your views 101 question.
> 
> To get your IndexController/indexAction working, you also need a corresponding view.  So in your modules views folder, create a subfolder index (which would be for all the actions in the IndexController), and a file index.phtml, which would be for the IndexController/indexAction.
> 
> For a different action in the IndexController, you would create a different phtml file in your index subfolder, and for the FooController.barAction, you would create view/foo/bar.phtml.
> 
> You can see the batchmake module as an example for this index view, that one simple to understand as it does practically nothing!

*********************************************
    Mona Wong
    Web & iPad Application Developer
    San Diego Supercomputer Center

    "Forgive everyone everything."
				-- Regina Brett
*********************************************




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/midas/attachments/20120704/0e646f25/attachment.html>


More information about the Midas mailing list