Zend 2 Skeleton. Customize Application module or create own module? - zend-framework2

I downloaded the Zend 2 Skeleton Application which comes with the module "Application". This module is the central point of the "Framework".
Now I want to add some routes/pages like "terms", "contact" etc. That brings me to the essential question:
Is it best practise to customize the "Application" module or am I supposed to create my own module? Especially if I want to add some static pages? If I'm gonna customize the Application module I can't update the Framework via composer anymore, I guess.
Thanks for everyone's help.

It depends. If you wanna edit this "static pages" via wysiwyg make separate module for pages (CMS ?)
If you will have pure static pages just add new controllers to Application.
Current trend is to make API in backend and use some frontend framework for front (so front-end will be responsible for load proper views)

Related

Is it possible to remove all .Net MVC components in a .Net Web Api application so that I can use AngularJS as the front end?

I'm creating an application with a .Net Web Api project wanting to use pure AngularJS as the client side. Since Web Api is built on top of MVC, it creates MVC specific and default items that I feel is not needed. These items include the HomeController, _ViewStart.cshtml, _layout.cshtml, etc. I tried removing them but it comes up with errors. Has anyone tried to remove the MVC stuff out of the web api project and used separate client side front-end? Is it even possible to remove the MVC items without errors?
Remove RouteConfig.cs from App_Start, remove the Views directory and all sub-directories including the Views internal web.config file. Comment out or delete all the lines in the Global.asax.cs Application_Start method except GlobalConfiguration.Configure(WebApiConfig.Register). Remove the HomeController, add an index.html and any needed Angular scripts and go at it. I also added solution folders to organize my views as reusing the existing Views folders did not work. I'm using VS 2015 but is should work for 2013 also. PWE
Web API is not built on top of MVC.
The default templates bring in MVC for the sake of supporting a help page, but you don't need to use it.
You can start with an empty web project and just check Web API.
The routing piece is server routing and it's part of what maps the URL to Controllers+Actions, it has nothing to do with Angular routing.
As Mike Cheel alluded to, there are no dependencies between MVC and Web API. However, if you use the built-in templates, it's easy to get the impression that the 2 are linked. They include a lot of stuff in these templates because they can't anticipate where you want to go with your project... so they try to cover all the bases.
For your purposes, you would probably be better off to start with an empty project and add only the components that you actually need. For this approach, some of the best tutorials and starter projects are from Taiseer Joudeh's "Bit of Technology" blog. His tutorials helped me to build an "MVC Free" web application from scratch that uses JSON Web Tokens and AngularJS Interceptors for security and Web API 2 and Entity Framework to serve up the data.
He has many tutorials on his website... but you might want to start with "AngularJS Token Authentication using ASP.NET Web API 2, Owin, and Identity". What what.. you didn't ask about security? Well... security is an issue that you will need to confront at some point anyway... and Taiseer presents a nice solution for securing an Angular/Web API application.

zend framework 2 out of the box modular system

I want to make a modular CMS in Zend Framework 2 . Like News module , Gallery module and etc...
How to make independent module in zf2 ? My biggest challenge in this case is configuring other modules like Zfcadmin and BjyAuthorize modules.
How Can I set all configurations in my own module ? Is it possible ?
You can config other modules in your module. For example you can add child route of ZfcAdmin in your news module . There is no obligation to configure each module in its module.config.php file. Remember modules are just namespaces
You should definitely have a look at ensemble if you want to develop your own CMS. Ensemble is built on top of ZfcAdmin so you can hook into both if you want to.
Disclaimer: I am the author of both Ensemble and ZfcAdmin
With regard to the configuration of ZfcAdmin, you should definitely start with the documentation. It's provided in the repository of ZfcAdmin. There is also a single page document about BjyAuthorize how to configure the module.
If you are not familiar with ZF2 and modules of ZF2 in general, I suggest to follow the user guide first.

Orchard CMS with MVC Web App

I need to build a simple Asp.Net MVC web app with a couple of forms / grids pages. This app will accessible through a public-facing website which is using Orchard. I'd like the app to run on top of Orchard as well, preferably within the same Orchard "site", to make use of the themeing and possibly some content management.
What I've tried so far is to make the entire app a module that I use in the public-facing Orchard site. This is sort of working, but changes I make to the module after it's added aren't being reflected, and none of my breakpoints are hit in the module.
Am I going down the right road with the module, or is there a better way to get this level of customization while still being able to use my public-facing site's theming and content management?
Things to check:
You need a manifest in your module's folder
The feature needs to be enabled in Orchard
You need routes to be defined in the module rather than in global.asax (look at any routes.cs)
But this is definitely the way to go.

Localize the content of a Link Module in DNN

I am using the default Links module to create a list of links in DotNetNuke.
So I have added the module inside the page and gave a title of "Links". Then I have added two links pointing to page of my site (Link 1 and Link 2).
Now I would like to translate the page and its modules to another language. I have been able to translate everything on the page except the title of every link inside the module (Link 1/Link 2).
Is there a way to accomplish this? Am I using these features in the correct way?
Generally speaking, is there a way to localize DNN standard modules?
A bit late but might I suggest the ealo text html module. This might be the solution
With core localization features (as of 5.6) - when you localize a page you are effectively making a copy - and the intent is that you localize the text in the module on the second page manually - meaning that you physically update the second links module's text/links etc.

Re-using model in multiple applications

Due to hosting constraints I am porting an ASP.NET MVC to Ruby On Rails. In my ASP.NET application I had 2 web applications. One for the Admin section, and one for the public section.
Both referenced a class library that held all my Business Logic and Data.
Now I want to accomplish the same thing in Ruby On Rails. How do I use my model in two applications?
First shot: put the business logic and associated models in a plugin.
Second shot: use SVN externals or Git submodules to replicate the exact code in your app, for example under APP_ROOT/lib/ and then require it in your environment.
And last... why not putting the admin and public section in the same app?
I would create a plugin. Call it IceheatSharedLogic or something. Add the model and supporting code to the plugin and commit it to its own source control location. Add that plugin via svn:externals or equivalent to both apps.
But given your use case, is it really necessary to have 2 apps? It seems that would make things complicated if you ever needed any interaction between them (such as putting an edit link on a page, if you are logged in as an admin).

Resources