Maybe my approach is all wrong, but I am going to have a bunch of partial views that will be rendered dynamically
using ajax.
Example of some partial views I currently have:
_facebook.php
<div id="facebook" class="social-input">
<h4>FaceBook</h4>
<?php echo $form->hiddenField($promotion,'promote_facebook', array('id'=>'promote_facebook', 'value'=>'true')); ?>
<?php echo $form->dropDownListRow($promotion, 'facebook_page', CHtml::listData($promotion->get_fb_pages(), 'facebook_pages_id', 'page_name')); ?>
<p class="note">All Fields are optional. Leave them blank to use defaults.</p>
<?php echo $form->textFieldRow($promotion, 'facebook_title');?>
<?php echo $form->textAreaRow($promotion, 'facebook_caption');?>
<?php echo $form->textAreaRow($promotion, 'facebook_description');?>
<?php echo $form->textAreaRow($promotion, 'facebook_message');?>
<button id="delete-facebook" class="delete-social-input" type="button">Delete</button>
</div>
_twitter.php
<div id="twitter" class="social-input">
<h4>Twitter</h4>
<?php echo $form->textAreaRow($promotion, 'twitter_message'); ?>
<button class="delete-social-input" type="button">Delete</button>
</div>
What Yii component can I use that will allow me to create partial views without duplicating the same layout for each?
The layout of these partial views will be the same with only the text in [] being different. I was hoping to do something like this:
<div class="social-input">
<h4>[PARTIAL VIEW TITLE]</h4>
[ActiveForm textAreas, textFields, dropDowns, etc go here]
<button class="delete-social-input" type="button">Delete</button>
</div>