cool thanks for the tip, yeah I've actually tested in the element and
printed it on the element like this

<form method="POST" action="assets/post.php">
        <label for="numMonths">Number of months:</label>
        <input align="right" maxlength="2" size="1" type="textbox"
name="numMonths" value="<?php echo $username ?>"/>
        <div class="spacer"></div>
        <label for="archiveInt">Archive Interval:</label>
        <input maxlength="2" size="1" type="textbox" name="archiveInt"
value="<?php echo $archives['archive']['archive_interval']; ?>"/>
        <div class="spacer"></div>
</form>

On Dec 15, 2:48 am, MrTufty <[EMAIL PROTECTED]> wrote:
> 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 cake-php@googlegroups.com
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