Welcome Guest, Not a member yet? Register   Sign In
Can't associate controller function with rule group -- Config Validation
#3

[eluser]jbibbings[/eluser]
Why is this bad practice?

I have users who can select multiple shipping addresses. There is a page that lists all of the addresses, and allows them to edit. In order to know which address to pull from the database, I need a reference.

Because this is a page that just lists the addresses, there is no form to post - just an edit button that uses an anchor tag and sends a get request.

Code:
<div class="addresses">
<ul>
    &lt;?php foreach($address as $row){ ?&gt;
    <li>
    <h3>&lt;?php if(empty($row->addressname)){ echo "- Untitled -"; } else { echo $row->addressname; } ?&gt;</h3>
    <div class="vcard"><span class="fn">&lt;?php echo $row->contactname; ?&gt;</span>
    <span class="email">&lt;?php echo $row->recipientemail; ?&gt;</span>
    <span class="tel">&lt;?php echo $row->recipientphone ;?&gt;</span>
    <span class="rext">&lt;?php if(!empty($row->rext)) echo 'Ext.' . $row->rext; ?&gt;</span>
    <span class="adr"> <span class="street-address">&lt;?php echo $row->address1; ?&gt;</span>
    <span class="extended-addres">&lt;?php echo $row->address2; ?&gt;</span>
    <span class="locality">&lt;?php echo $row->city; ?&gt;</span>,
    <span class="region">&lt;?php echo $row->state; ?&gt;</span> <span class="postal-code">&lt;?php echo $row->zip; ?&gt;</span> </span>
    </div>
    
    &lt;!-- echo the address row onto the end of the edit and delete urls --&gt;
    <p class="action"><href="&lt;?php echo site_url('account/edit_address/' . $row->address_id ?&gt;" class="edit">Edit</a

<href="&lt;?php echo site_url('account/delete_address/' . $row->address_id ?&gt;" class="remove">Delete</a></p>



    </li>
    &lt;?php } ?&gt;
</ul>
</div>

How would you do this differently?


Messages In This Thread
Can't associate controller function with rule group -- Config Validation - by El Forum - 07-22-2011, 08:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB