Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

PHP - Show/hide value for multiple datas

0 votes
2 views
added Mar 27 in PHP by LC Marshal Lieutenant (14,830 points)
​//Show/hide values for multiple lines
<?php if(
  !(
    empty($profile->field_address_line_1->value()) &&
    empty($profile->field_address_line_2->value()) &&
    empty($profile->field_zip->value()) &&
    empty($profile->field_area->value()) &&
    empty($profile->field_state->value())
  )
): ?>     
<div class="_row">
  <div>
      <i class="fa fa-map-marker" aria-hidden="true"></i>
      <?php if(!empty($profile->field_address_line_1->value())): ?>
        <?php print $profile->field_address_line_1->value(); ?>
      <?php endif;?>
      <?php if(!empty($profile->field_address_line_2->value())): ?>
        <br/>
        <?php print $profile->field_address_line_2->value(); ?>
      <?php endif;?>
      <?php if(!empty($profile->field_zip->value())): ?>
        <br/> Postal Code:
        <?php print $profile->field_zip->value(); ?>
      <?php endif;?>
      <?php if(!empty($profile->field_area->value())): ?>
        <br/>
        <?php print area_id_to_name($profile->field_area->value()); ?>
      <?php endif;?>
      <?php if(!empty($profile->field_state->value())): ?>
        <br/>
        <?php print state_id_to_name($profile->field_state->value()); ?>
      <?php endif;?>
  </div>
</div>
<?php endif;?>

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...