MiniMVC升级,支持类Razor语法

模板:

<div class="content">
    $for(var v in ls){
        $if(v>10){
<div style="color:Red;">$v</div>}else{<div>$v</div>}
    }
</div> 

控制类: using System.Collections.Generic;


namespace Cvv.WestcoMarketing.WebApp.PageControllers
{
    
class Index : BaseController
    {
        
public void Run()
        {
            List
<int> ls = new List<int>();

            
for (int i = 0; i < 20; i++)
            {
                ls.Add(i 
* i * i);
            }

            ViewData[
"ls"= ls;
        }
    }
}

开源地址:https://github.com/sskycn/minimvc

项目介绍:http://www.minimvc.com

原文地址:https://www.cnblogs.com/afxcn/p/2118947.html