Zend Framework 2 FrontController Plugin - zend-framework

I have decided to rewrite an application that I wrote a long time ago in ZF1. A key part of this is the utilisation of a FrontController plugin that looks at a URL and if no matching route is found it will pass it on to another controller to process.
The benefit of this is it worked for all modules without having to make further changes as it was registered as a plugin for the frontcontroller.
Can someone please help as to how I could achieve the same in ZF2
Thanks in Adavance
Adam

Now you can do it in Events.
ZF2 have default events and you can attach your code(listeners) to particular event. List of all ZF2 default events.
You have to play around with ZF2 events/listeners to see what will be the best choice for you.
I am doing similar staff in MvcEvent::EVENT_ROUTE. Check current route, check current user permission and if user don't have permission just return different response.
There you can found great article about how to create event/listener
"Understanding the Zend Framework 2 event manager".

Related

Zend 2 login application

This is my first time using Zend Studio and I am trying to create Zend2 Login Application.
I need help with creating simple login form where I can able to submit my form. Since this is my first time on zend2 so it is hard for me to create simple application with following rule of zend2.
Any help will work.
I suggest you to have a look at ZfcUser, a Zend Framework 2 module for managing user registration and authentication. It comes already with working routes and forms. Then, if you want, you could customize the look and feel and also how the module works overriding some components or better using the events that the module is exposing

Some questions before choosing/start learning Yii framework

I've been developing simple PHP/MySQL web sites for some years.
Never used a PHP Framework before and I understand I'll need to know OOP, no problem.
I'm about to start a SaaS project of my own.
A)
So far, I've seen Yii generates the CRUD and pages according to the DB.
Is it easy to modify the generated code?, like, adding a new DB field and its form field without not generating again all the stuff every time I change something in the DB and losing other customizations?
I mean, I'm 100% sure the generated DB code and pages are not going to be enough and I'll be constantly adding and correcting fields, and adding more tables etc.
B )
My project will include a Shopping Cart and Calendar(for events, tasks, etc.).
Does Yii has these options or at least an easy way to implement it like the Authentication options or Database listing, etc.?
C) Does documentation has this explained as a tutorial/book or is more like a reference(minimum explanation that only advanced user understand how to integrate it)?
thank you very much
Yiiframework has excelent documentation (you can start from here). Also there is an extensions area in the downloads section where you can find all available yii extensions.
All your questions can be answered if you follow their easy tutorial.
A) Yes, it's easy. You will just add code for new fields not changing it all.
B and C are answered by Stratosgear very well.
Is it easy to modify the generated code?
Yes it is. If you later decide to add more fields to the table, you can do that from your Phpmyadmin using sql commands.
You also need to edit the generated class file adding those new fields to correspond with that on your table.

Joomla1.5 CRUD extension tutorial

I need to build a basic CRUD joomla extension for a customer.
On the user's side, it must display a product list when the user choose a category, and the product details when an item is selected in the list. On the product details page, the user can send a message to the site's owner regarding the chosen product.
On the admin side, user must be able to add/modify/delete products and categories. That's about it.
Does anybody knows (a) good tutorial(s) that could help me get started with this project?
I've worked with php 4 years ago and have 5+ years experience in web development (.net), but i'm new to joomla.
Thanks in advance!
Sounds like to me you are looking for an e-commerce extension with a catalog mode (no purchases/no cart enabled) and an Ask a Question form on product pages. I know that at least Virtuemart has this ability exactly. I am sure there are other simpler carts that will also accommodate your need. http://extensions.joomla.org/extensions/e-commerce/shopping-cart
Spend a couple of hours trying out carts, no code writing required.
A great place to start is the Joomla docs site.
Checkout Component Development section.
Also, here is MVC Component Tutorial (there are 6 section to it, look for links at the bottom for "Next"), it will definitely put you on the right track. You will have to add a lot of your project specific things and do out of the box things, but it should be pretty easy.
Just keep things separate to make it easier
View/Template - your presentation
Controller - logic
Model - Data Access Layer (DAL)

Zend Framework and clients User Agent

I've created an application with the Zend Framework. Now I was asked to make an iphone webapp for it.
So my solution is to get the useragent and render a different view for it.
My searches on google lead to Zend_UserAgent but my library says it doesn't contain it. ;)
Is there any Zend way to find the useragent to render a different view or should I do it another way?
Thanks in advance!
You can use $_SERVER['HTTP_USER_AGENT'] to determine which view to show. Here's a list of all available user agents.

Create admin module and configuration in Zend Framework 1.9.0

I am working with zend framework for last 2 months. I got zend framework latest version 1.9.0.
I am new in zend framework programming. I am learning one by one.. in zend framework. Now i am confused with creating admin module in zend and their configuration settings. Please help me to create admin module with in the module folder in zend framework.
Thanks and regards,
Prasanth P
Using Zend_Tool you can create modules.
zf create module name
I did have a few issues when creating modules these two blogs were a great help (few articles on each). I was looking to have separate configs, layouts ect for each one, maybe not what you're after but good read anyway.
http://blog.vandenbos.org/2009/07/07/zend-framework-module-config/
We have a similar problem:
I am designing a large scale application with about 5 modules.
Even though I am not finding my way around, I think this blog post http://blog.astrumfutura.com/archives/415-Self-Contained-Reusable-Zend-Framework-Modules-With-Standardised-Configurators.html might be helpful for you and for anybody else. Please, update this thread if you find anything interesting. thanks.
use of this
http://www.skyrocket.be/2009/01/11/admin-cms-routes-in-zend-framework/