How to make "php if" for views block? I'm generate views content with this:

&lt;?php echo views_get_view('xtr')-&gt;preview('block_1', array(1)); ?&gt;


But I need to add slidewrap class only if the content available.

Below is what I've tried which not working:

&lt;?php if (views_get_view('xtr')-&gt;preview('block_1', array(1))): ?&gt;
  &lt;div class="slidewrap"&gt;&lt;?php echo views_get_view('xtr')-&gt;preview('block_1', array(1)); ?&gt;&lt;/div&gt;
&lt;?php endif; ?&gt;
1.If you want to just add a class to the content of view container you can add it from the view itself 


if you have a template file for views you can add the class there. or you can set it as in views header and footer