Revision #4 has been created by bluyell on Jan 22, 2013, 6:16:36 AM with the memo:
sign
« previous (#3)
Changes
Title
unchanged
simple CSV export
Category
unchanged
How-tos
Yii version
unchanged
Tags
unchanged
csv, excel, export
Content
changed
<html>
<div style='padding: 3px; background-color: #fe9; border: #aaa; border-radius: 3px;'>
Por: <b><a href='https://plus.google.com/107716720815385421516' rel='author' title='author profile'><span itemprop='name'>Christian Salazar</span></a></b>
<a href="https://twitter.com/salazarchris74" class="twitter-follow-button" data-show-count="false" data-lang="es">Follow @salazarchris74</a>
</div>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-5791317089514247";
/* firma */
google_ad_slot = "6843698352";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</html>
Hello everyone, this simple component extract data to CSV. The main difference with others is the ability to format each column using Yii::app()->format functions in a very similar way as CGridView does.
1. **This component can output the result directly to your browser as a downloadble CSV**, so use the input arguments to provide a filename, if not, the output will be returned as a string.
2. **The input argument to be converted to CSV must be any array of CModel objects**, or any indexed array like $ar['key1'],$ar['key2']. You can pass an CActiveRecord array to this component too.[...]