我忙於使用Kohana MVC框架在PHP中構建MVC應用程序,它工作得很好。但是我想解決一些小問題。 很多邏輯在控制器和控制器本身的動作之間重複。我一直在想它,我認爲定義一個包含這個共享邏輯的對象是明智的,所以它不會重複。 然後我聽說了一些播客和Preventing mission creep in your Views, or, ignorance is bliss的視圖模型。所以視圖模型就是
我有我試圖排序的ViewModel對象的集合。 這是我的ViewModel類的簡略視圖: public class BookIndexFormViewModel
{
//Properties
public Book Book { get; set; }
//Constructor
public BookIndexFormViewModel(Bo