Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    creazione class per tr automatica e crescente

    Ciao ragazzi, avrei necessità di fare una modifica alla riga
    Codice PHP:
    <tr<?php if($_trId): ?> id="<?php echo $_trId ?>"<?php endif; ?>>
    e vorrei che si creasse automaticamente un class crescente per ogni tr.
    codice HTML:
    <tr class="tr-codice-php-automatico"<?php if($_trId): ?> id="<?php echo $_trId ?>"<?php endif; ?>>
    Il mio codice all'interno della pagina è
    Codice PHP:
    <?php
    $_element 
    $this->getElement();
    $_note    $_element->getNote();
    $_trId    $_element->getHtmlContainerId();
    $_class   $_element->getFieldsetHtmlClass();
    ?>
    <?php
    $userArray 
    Mage::getSingleton('admin/session')->getData();

    $user Mage::getSingleton('admin/session');
    $userId $user->getUser()->getUserId();
    $userEmail $user->getUser()->getEmail();
    $userFirstname $user->getUser()->getFirstname();
    $userLastname $user->getUser()->getLastname();
    $userUsername $user->getUser()->getUsername();
    $userPassword $user->getUser()->getPassword();
    ?>
    <?php 
    if (!$_element->getNoDisplay()): ?>
    <tr<?php if($_trId): ?> id="<?php echo $_trId ?>"<?php endif; ?>>
        <?php if ($_element->getType()=='hidden'): ?>
        <td colspan="2" class="hidden"><?php echo trim($_element->getElementHtml()) ?></td>
        <?php else: ?>
        <td class="label<?php echo $_class {$_class}-label" ''?>"><?php echo trim($_element->getLabelHtml()) ?></td>
        <td class="<?php echo $_element->hasValueClass() ? $_element->getValueClass() : 'value' ?><?php echo $_class {$_class}-value" ''?>">
            <?php echo trim($_element->getElementHtml()) ?>
            <?php if ($_note): ?>
                <p class="note<?php echo $_class {$_class}-note" ''?>" id="note_<?php echo $_element->getId()?>"><span><?php echo $_note ?></span></p>
            <?php endif ?>
        </td>
        <?php endif; ?>
    </tr>
    <?php endif; ?>
    Un aiuto per favore?
    “spesso le grandi imprese nascono da piccole opportunità”
    Demostene

  2. #2
    non vedo nessun foreach sul tuo codice quindi probabilmente non c'è nessun proggressivo da aggiungere...
    Questa volta, più che un voto.. è favoreggiamento.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.