Nope, can't see anything wrong with that. As written, the code will
not generate an error (unless you got an iffy nightly build). Search
your real controller code and make sure you haven't defined index()
twice.
On Oct 10, 11:19 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> <?php
> class MyExampleController extends AppController
> {
> var $name = 'MyExample';
> var $helpers = array('Html', 'Form', 'Javascript', 'Fck', 'Ajax');
>
> var $components=array('Auth');
>
> function admin_index()
> {
> echo "ADMIN";die();
> }
>
> function index()
> {
> echo "USER";die();
> }
>
> }
>
> ?>
>
> On 10 Ott, 12:15, grigri <[EMAIL PROTECTED]> wrote:
>
> > The answer to your first question is in the manual. In the components
> > section.
>
> > Your second question might be more interesting. You've probably just
> > got a typo somewhere - paste your code (if it's long then use cakebin,
> > pastebin, or paste monkey - if it's short just paste it here).
>
> > On Oct 10, 10:07 am, "[EMAIL PROTECTED]"
>
> > <[EMAIL PROTECTED]> wrote:
> > > Hi
> > > I have two questions :
> > > First:
> > > How can i access to session component inside another component?
> > > I try use $this->Session but it doesn't work.
>
> > > Second:
> > > I have set CAKE_ADMIN in my core.php.
> > > Now I would have two index view for my application , one for user and
> > > one for admin.
> > > So I created in my controller a function index and a function
> > > admin_index but when i try that i get an error "Cannot redeclare
> > > index()"
> > > How can I resolve this problem?
> > > Many thanks
> > > Marco
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---