[Midas] controllers/IndexController.php
Zach Mullen
zach.mullen at kitware.com
Wed Jul 4 22:11:03 EDT 2012
Not sure if you actually are doing this in a module called "example", but
note that the controller class name must begin with the module name itself.
So, within the "annio" module, the class would have to be called
"Annio_IndexController".
On Wed, Jul 4, 2012 at 7:47 PM, Mona Wong <mona at sdsc.edu> wrote:
>
> 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
> *********************************************
>
>
>
>
>
> _______________________________________________
> Midas mailing list
> Midas at public.kitware.com
> http://public.kitware.com/cgi-bin/mailman/listinfo/midas
>
>
--
Zach Mullen
R & D Engineer
Kitware Inc.
919-869-8858
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/midas/attachments/20120704/972883bf/attachment.html>
More information about the Midas
mailing list