model-view-controller

Action View Helper in Zend - Work around?

无人久伴 提交于 2019-12-29 06:15:55
问题 I'm working on building up an interface that I want to function as a "tabbed browsing" sort of function. Each of these tabs has already been written as an action and the tabbed interface works fine as links to the individual tabs. I decided to try writing the "index" page for this controller - putting the content of all the tabs into hidden divs and swapping between them with jQuery, but once I started to use the action view helper - I ran into a lot of people saying that its bad practice.

Action View Helper in Zend - Work around?

送分小仙女□ 提交于 2019-12-29 06:15:06
问题 I'm working on building up an interface that I want to function as a "tabbed browsing" sort of function. Each of these tabs has already been written as an action and the tabbed interface works fine as links to the individual tabs. I decided to try writing the "index" page for this controller - putting the content of all the tabs into hidden divs and swapping between them with jQuery, but once I started to use the action view helper - I ran into a lot of people saying that its bad practice.

Is the Controller in MVC considered an application service for DDD?

末鹿安然 提交于 2019-12-29 04:34:28
问题 I am applying DDD for the M part of my MVC and after some research (studying up!), I have come to the realization that I need my controller to be interacting with domain services (in the model). This would make my controller the consumer of the domain services and therefore an application service (in DDD terms). Is this accurate? Is there a difference between a controller and what DD defines as an application service? 回答1: The controller is not considered a service in DDD. The controllers

Having a single entry point to a website. Bad? Good? Non-issue?

青春壹個敷衍的年華 提交于 2019-12-29 04:30:14
问题 This question stems from watching Rasmus Lerdorf's talk from Drupalcon. This question and his talk have nothing specifically to do with Drupal, by the way... it was just given at their con. My own question also has nothing specific to do with PHP. It is the single entry point in general that I am curious about. These days it seems that most frameworks offer a single entry point for whatever you build with them. In his talk Rasmus mentions that he thinks this is bad. It seems to me that he

What's the best approach to divide model and actions into classes in MVC pattern

强颜欢笑 提交于 2019-12-29 01:59:09
问题 Let's say I have a class Employee with a huge amount of fields. And I have a lot of actions related to db with it like CRUD, filter etc. In MVC pattern all of these stuff could be placed into one class of Model part. But again, what if I have a lot of fields and a lot of actions. How to properly split to classes the basic object staff (fields, basic methods: getters & setters, toString etc.) and the actions. Like Employee and EmployeeActions ? Or any best approach? Need your experience) 回答1:

How to disable right click on IFRAME

偶尔善良 提交于 2019-12-29 01:42:51
问题 I have a document content displayed on IFrame in MVC web application. The content should not be copied and printed . I tried to disable right click using two functions style="pointer-events:none;" oncontextmenu="return false" for Iframe, which is working fine. But on right click, the pop up with 'View Frame Source', 'View Source' are displaying. How can I restrict this.! Also, how to restrict the print screen option. I know there are other utilities from where anybody can capture data. But

Attaching an entity of type failed because another entity of the same type already has the same primary key value.

喜欢而已 提交于 2019-12-28 18:14:42
问题 Let me quickly describe my problem. I have 5 databases for 5 customers and each has the same table called SubnetSettings . I already created a dropdownlist to select a customer and will shows up the SubnetSetting table which belong to selected customer and allow me to create, edit and delete. I can create, delete without problem but when I want to edit the data it brings the error: Server Error in '/TMS' Application. Attaching an entity of type 'CFS.Domain.Entities.SubnetSettings' failed

Reading Excel spreasheet using EPPlus

荒凉一梦 提交于 2019-12-28 13:47:14
问题 Could someone point me in the right direction on how to read a Excel spreasheet, loop through all the rows and columns to retreive value using EPPlus and MVC? So fare I see examples to create a spreasheet, but did not find any on opening an excel file and read values from it. Any help would be appreciated. TIA Sue.. 回答1: Simple example // Get the file we are going to process var existingFile = new FileInfo(filePath); // Open and read the XlSX file. using (var package = new ExcelPackage

How to route a multiple language URL with a MVC

浪子不回头ぞ 提交于 2019-12-28 11:56:39
问题 I need multi-language URL route of existing controller. Let me explain more: I have a controller with name "Product" and View with name "Software"; therefore, by default if the user enters "http://example.com/en/Product/Software", get right content (that really exists in http://example.com/Product/Software), However, if another user -- a French user -- types "http://example.com/fr/Produits/logiciels", must get above controller and show with right content (same http://example.com/Product

The ViewData item that has the key 'CategoryId' is of type 'System.Int32' but must be of type 'IEnumerable<SelectListItem>'?

拈花ヽ惹草 提交于 2019-12-28 09:13:13
问题 So my code was working before. I don't know what I did for this to happen and I can't seem to fix it. I've seen people say to reset the ModelState. ( ModelState.Clear(); ) But that didn't help. Also, it doesn't help that I'm still fairly new to MVC. Any help would be appreciated. Thanks. Controller: public ActionResult Create() { ActiveDirectoryModel adm = new ActiveDirectoryModel(); ViewBag.notifyto = adm.FetchContacts(); var model = Populate(); return View(model); } [HttpPost] public