0
我試圖讓在笨添加和編輯一個視圖,當我嘗試更新HTML元素顯示,但是當我需要使用額外的元素隱藏我知道的問題是,我使用的foreach我能做些什麼來使工作蔭試圖讓在笨添加和編輯一個視圖,當我嘗試更新HTML元素顯示,但是當我需要使用添加元素隱藏
<?php include_once 'Header.php'; ?>
<div class="panel-body">
<div class="row">
<div class="col-lg-6">
<?php if($Operation == 2){ foreach ($records as $value) :?>
<?php if($Operation == 1) {echo form_open_multipart('Slider_Controller/AddNewSlid');} else if($Operation == 2){echo form_open_multipart('Slider_Controller/UpdateSlid/'.$value->Slid_ID. ''); } ?>
<div class="form-group">
<label>Slider Title</label>
?>
<input type="text" name='SlidTitle' class="form-control" value='<?php if($Operation == 2){echo $value->Title; } else { echo ""; }?>' placeholder="Slider Title">
</div>
<div class="form-group">
<label>Upload Icone</label>
<input type="file" name='userfile'>
</div>
<div class="form-group">
<label>Description</label>
<textarea class="form-control" rows="3" name='SlidDescription'><?php if($Operation == 2){echo $value->Description; }else if($Operation == 1){ echo null;}?></textarea>
</div>
<div class="form-group">
<label>Select Slide status</label>
<select class="form-control" name='Staus'>
<option value='0'>Select status</option>
<option value='1' <?php if($Operation == 2){if ($value->Status == "1"){echo 'selected="selected"';}}?>>Active</option>
<option value='2' <?php if($Operation == 2){if ($value->Status == "2"){echo 'selected="selected"';}}?>>NonActive</option>
</select>
</div>
<?php endforeach; } ?>
<input type="submit" name='fffff' value='go'>
<button type="reset" class="btn btn-default">Reset Button</button>
<?php echo form_close(); ?>
<?php echo validation_errors('<span class="error">', '</span>'.'<br>'); ?>
</div>
<!-- /.col-lg-6 (nested) -->
<!-- /.col-lg-6 (nested) -->
</div>
<!-- /.row (nested) -->
</div>
<!-- /.panel-body -->
<?php include_once 'Footer.php'; ?>
只是一個小竅門,你不需要使用包括加載意見閱讀此https://www.codeigniter.com/user_guide/general/views.html#loading-multiple-views – user4419336
請問您可以添加您的控制器代碼? –