Simple colum formatting in Yii 2 GridView
2016-08-15 10:14
148 查看
A very important widget in the business apps development is the GridView control. In this post I will show how to use its hidden capabilities to format the displayed data.
<?= GridView::widget([ 'dataProvider' => $dataProvider, 'columns' => [ 'Title', // same as 'Title:text' 'Snippet:html', // will be HTML purified 'Description:ntext', // plaintext but new lines as <br> 'Email:email', // will be shown as mailto: link 'WebSite:url', // will be shown as hyperlink 'Picture:image', // <img src="value of Picture column" /> 'Maried:boolean', // true or false 'Birthdate:date', 'Birthdate:time', 'Birthdate:datetime', 'Birthdate:timestamp', 'Size:integer', 'Cost:spellout', // number as text 'DiskSize:size', // as bytes, for example `12 kilobytes` 'Size:decimal', 'Ratio:percent', ] ); ?>
相关文章推荐
- YII中actionadmin对应的gridview数据的排序
- warning: push.default is unset; its implicit value has changed in Git 2.0 from 'matching' to 'simple
- yii, gridview隐藏查看view按钮以及自定义查看按钮链接
- a simple android user interface in java
- Design Pattern in Simple Examples
- SimpleDateFormat in Java is not Thread-Safe Use Carefully
- The first day in the simple world.
- Simple ABAP - Create allowed values in a characteristic by BAPI_CHARACT_CREATE
- Create a simple report in Dynamics AX 2012 R3
- CUDA(7)之A poor simple sample to perfectly introduce how to program in CUDA
- Yii2.0小部件GridView(两表联查/搜索/分页)②
- Simple guide to forks in GitHub and Git
- Dynamically Creating Bound and Template Columns in GridView
- Gridview in ASP.NET MVC /asp.net mvc中的表格视图控件
- Export GridView To WordExcelPDFCSV in ASP.Net
- Creating a simple Flex Accordion inline header renderer
- Simple Digit Recognition OCR in OpenCV-Python
- 在VS2005中 GridView导入Excel的两点小技巧 VerifyRenderingInServerForm
- Simple Messenger Developed in .NET Using C#
- IFC(Inline formatting contexts)学习