Fork me on GitHub

I am sure this isn't right but am i close?  Bottom

  • In pnadmin.php:

    Quote


    $pnRender->caching = false;

    $years = array();

    $today = getdate();
    $thisYear = $today['year']+1;
    $intStartYear=1900;
    while ($thisYear >= $intStartYear){
    $years[] = $intStartYear;
    ++$intStartYear;
    }

    return $pnRender->fetch('roqFacilities_admin_new.htm');


    in roqFacilities_admin_new.htm:

    Quote

    <select name="year">
    <option selected="selected">(choose year)</option>


    <option value=""></option></select>
  • The syntax between PHP and pnRender is a bit different, try:

    Quote

    <select name="year">
    <option selected="selected">(choose year)</option>


    <option value=""></option>


    </select>


    or just:

    Quote

    <select name="year">
    <option selected="selected">(choose year)</option>


    <option value=""></option></select>
  • that isn't working either. all that shows up is (choose year).
  • try:

    Quote

    <select name="year">
    <option selected="selected">(choose year)</option>

    <option></option>

    </select>


    Does the calling function use this:

    Quote

    $pnRender =& new pnRender('modname');
    ...
    $pnRender->assign('year', $years);
    ...
    return $pnRender->fetch('modname_admin_funcname.htm');

    ?

    You might try a static call too, like "<option></option>", to see if the array is being passed. Also check your HTML output to see if any extraneous output is there.
  • that was it!

    Code

    $pnRender->assign('year', $years);


    didn't have that line.

    so is "year" in admin.php equal to "$year[]" in the .htm file

    also what is the

    Code

    <!--[section]-->


    all about? I added it cause it was in the tutorial, but do not know what it is or references.
  • how would i go about adding option "value"

    say for instance if i wanted the value to equal the year
  • <option value="..."> only needs to be defined if it is different than the text between the option tags. You can specify as you did above, if necessary.

    Quote



    is just a for loop... in pseudo-code: for mysec = 0 to size($year)

    Quote



    closes the loop.

    as you've likely figured out

    Quote

    $pnRender->assign(pnRender_var, php_var);


    passes the var from PHP to pnRender.

    I'm uncertain on the benefits of using "pnvarprephtmldisplay" or "strip", but experimentation should clear that up... or I suppose we could actually read the docs :)</option>
  • 0 users

This list is based on users active over the last 60 minutes.