sohel wrote:Hi,
I read the tutorials of the docs.
I've created the most simple plugin for my purpose.
/Controllers/HandelController.cs
using Nop.Web.Models.Customer;
using Nop.Web.Framework.Controllers;
using System.Web.Mvc;
namespace Nop.Plugin.Misc.Handel.Controller {
internal class HandelController : BasePluginController {
public ActionResult HandelRegister() {
var model = new RegisterModel();
return View("~/Plugins/Misc.Handel/Views/HandelRegister.cshtml", model);
}
}
}
/Infrastructure/CustomViewEngine.cs
using Nop.Web.Framework.Themes;
namespace Nop.Plugin.Misc.Handel.Infrastructure {
public class CustomViewEngine : ThemeableRazorViewEngine {
public CustomViewEngine() {
ViewLocationFormats = new[] { "~/Plugins/Misc.Handel/Views/Handel/{0}.cshtml" };
PartialViewLocationFormats = new[] { "~/Plugins/Misc.Handel/Views/Handel/{0}.cshtml" };
}
}
}
HandelPlugin.cs
using Nop.Core.Plugins;
namespace Nop.Plugin.Misc.Handel {
class HandelPlugin : BasePlugin{
public override void Install() {
base.Install();
}
public override void Uninstall() {
base.Uninstall();
}
}
}
RouteConfig.cs
using Nop.Plugin.Misc.Handel.Infrastructure;
using Nop.Web.Framework.Mvc.Routes;
using System;
using System.Web.Mvc;
using System.Web.Routing;
namespace Nop.Plugin.Misc.Handel {
class RouteConfig : IRouteProvider {
public int Priority {
get {
return 0;
}
}
public void RegisterRoutes(RouteCollection routes) {
routes.MapRoute("HandelRegister",
"handelregister",
new { controller = "HandelController", action = "HandelRegister" },
new[] { "Nop.Plugin.Misc.Handel.Controllers" });
ViewEngines.Engines.Insert(0, new CustomViewEngine());
}
}
}
/Views/Handel/HandelRegister.cshtmlAll Code from original register.cshtml