It is different since the subtab is updated by Ajax.  At least that's
what I think.

When I go directly to http://system/tabname/subtab, I get a message
saying (for instance) " Error:  The action spacecraft is not defined
in controller MissionsController"   In this case "spacecraft" is my
subtab and Mission is my main tab.  This makes sense in that I don't
have that routine defined.  However, I am at a loss for what to put in
that routine.  My attempt at it would be:

    function spacecraft ()
    {
        $this->render ('/elements/missions/spacecraft');
    }

which displays my text, but not the rest of the tabs (i.e. the stuff I
have on the index.ctp view).  What I'd like is:

$this->render ('index');
$this->render ('/elements/missions/spacecraft'); // this will just
"manually" switch tabs for the user.

Hope this makes sense!

Thanks!
Joey

On Oct 4, 12:15 pm, Miles J <[email protected]> wrote:
> And again, what your saying is exactly what a controller and action is
> for. How is that different than your setup?
>
> On Oct 4, 7:30 am, Joey Mukherjee <[email protected]> wrote:
>
>
>
> > In retrospect, I guess I didn't explain as well as I should have.
>
> > I have each subtab as an element now and every subtab is rendered via
> > ajax (i.e.  $js->link ($html->tag ('span', $side_button
> > ['title']),
> > array ('action'=> 'display/'.$side_button ['name']), $options).  The
> > controller action "display" just has a $this->render ("/elements/
> > $tabname/$whatToDisplay");
>
> > So, when the user goes tohttp://system/tabname, the initial view sets
> > up the element specific to that tab that views/layouts/default.ctp did
> > not setup.  Each subtab element just has stuff specific to that subtab
> > (in my case, mainly just text).
>
> > However, I'd like people to go tohttp://system/tabname/subtaband
> > directly render the specific text to that subtab.  That's what I can't
> > figure out??
>
> > Anyway, does this sound right to everyone?  I feel like I am the only
> > one having this problem on something which seems pretty common (tabs/
> > subtabs).  Is there  a better way of doing the above?  I'd welcome all
> > ideas!
>
> > Thanks for the response!
> > Joey
>
> > On Oct 1, 1:49 pm, Miles J <[email protected]> wrote:
>
> > > Just use the default MVC architecture?
>
> > > tabname = controller
> > > subtab = action
>
> > > On Sep 30, 12:05 pm, Joey Mukherjee <[email protected]> wrote:
>
> > > > I have some tabs along the top of my CakePHP site and some sub-tabs
> > > > along the left side of my page.  When I switch tabs, it goes to a URL
> > > > such ashttp://system/tabname.  When I go to a sub-tab, I use 
> > > > $this->render to update the content of the view to what the user clicked
>
> > > > on.  However, I'd like a URL such ashttp://system/tabname/subtabto
> > > > go directly to the subtab.
>
> > > > How might I accomplish this?  Basically, I want to redirect to tabname/
> > > > index and then render the subtab.
>
> > > > My tabname index view sets up the side menu.  The subtab just modifies
> > > > the inner content.  The views/layouts/default.ctp has the top tabs
> > > > defined in them.  Obviously, the side tabs change from tab to tab.
>
> > > > Hope that makes sense!
>
> > > > Thanks,
> > > > Joey

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to