UPDATE: I now see that drupal has a built in setting you can check to add even/odd,first, and last classes to the items in the view. Is there a way I can append another class to the last item using this?
For responsive purposes I was planning on adding the bootstrap .hidden-lg class to the last item in a view. This is in order to display more items when I go from a 3 column to a 2 column view. I did see that there was a style output template for views that iterates through each of the rows (as you can see below) but I wasn't sure how to take advantage of that.
<?php
/**
* @file
* Default simple view template to display a list of rows.
*
* @ingroup views_templates
*/
?>
<?php if (!empty($title)): ?>
<h3><?php print $title; ?></h3>
<?php endif; ?>
<?php foreach ($rows as $id => $row): ?>
<div<?php if ($classes_array[$id]) { print ' class="' . $classes_array[$id] .'"'; } ?>>
<?php print $row; ?>
</div>
<?php endforeach; ?>
Unless the only option is to perform some regex on the last item of the foreach statement.
As a heads up, I'm already outputting the content and applying custom classes using a view field output template.