One tip to avoid error messages like this would be to change the
definition of your function to:

function index($username = null) {

That way if a username is not passed, it doesn't break.

BUT, that doesn't solve your problem, which appears to be that the
username isn't being set at all - have you tried outputting $username
in the view, to see if it actually contains anything?

Tufty

On Dec 14, 9:24 pm, Fabian <[EMAIL PROTECTED]> wrote:
> I did the following
>
> <?php $archives = $this->requestAction('archives/index/'.$username); ?
>
>
>
> and then in the controller
>
> <?php
> class ArchivesController extends AppController {
>     var $name = 'archives';
>
>         //echo $username;
>     function index($username) {
>         $archives = $this->Archive->findByUser($username);
>         if(isset($this->params['requested'])) {
>              return $archives;
>         }
>         $this->set('archives', $archives);
>     }}
>
> ?>
>
> And I get this error:
>
> Warning: Missing argument 1 for ArchivesController::index() in C:
> \Program Files\xampp\htdocs\cake\app\controllers
> \archives_controller.php on line 5
>
> Notice: Undefined variable: username in C:\Program Files\xampp\htdocs
> \cake\app\controllers\archives_controller.php on line 6
>
> On Dec 14, 2:17 pm, jarmstrong <[EMAIL PROTECTED]> wrote:
>
> > You can get away with just adding the arguments after the function name 
> > using
> > slashes to split each argument.
>
> > You can do something like this:
>
> > <?php $archives = $this->requestAction('archives/index/'.$i_love_Cake); ?>
>
> > --
> > View this message in 
> > context:http://www.nabble.com/RequestAction-parameters-tp14339603p14339776.html
> > Sent from the CakePHP mailing list archive at Nabble.com.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to