How to create custom plugins in Zend Framework

Plugin is nothing else but the class, in our case it extends Zend_Controller_Plugin_Abstract.

This is assuming that you have your plugin in this directory: /path/to/library/My/Controller/Plugin/Example.php

And the Example.php file contains something like this.

<?php class My_Controller_Plugin_Example extends Zend_Controller_Plugin_Abstract {

   public function preDispatch(Zend_Controller_Request_Abstract $request) {
       //code for your plugin here...
   }

}

Please note that Zend Framework has a naming convention on this. For the classname: My_Controller_Plugin_Example, every underscode (_) is converted into a slash (/) to form a directory structure. So, the classname ‘My_Controller_Plugin_Example’ would be read as /My/Controller/Plugin/Example.php by Zend Framework — with the ‘My’ folder inside the ‘library’ folder

So the key things to remember are:

  1. Register your custom plugin in your application.ini
  2. Make sure that you load your namespace in the application.ini. In this example, it should be ‘My’
  3. Make sure that you have your classname-to-directory structure is correct

To register your own custom plugin in the new Zend Framework, go to your application.ini file found in the configs directory and add this:

autoloaderNamespaces[] = "My_" resources.frontController.plugins.Example = "My_Controller_Plugin_Example"

Or

You can register plugin in Bootstrap.php file

You would need first to load your plugin class (via Zend_Loader or require_once) then create your plugin yourself:

$plugin = new My_Controller_Plugin_Example(); $front = Zend_Controller_Front::getInstance(); $front->registerPlugin($plugin);


http://www.f1teksolutions.com/zendframework/how-to-create-custom-plugins-in-zend-framework/

 

The article How to create custom plugins in Zend Framework has been proposed for deletion because of the following concern:

delete per WP:NOTHOWTO.

While all contributions to Wikipedia are appreciated, content or articles may be deleted for any of several reasons.

You may prevent the proposed deletion by removing the {{proposed deletion/dated}} notice, but please explain why in your edit summary or on the article's talk page.

Please consider improving the article to address the issues raised. Removing {{proposed deletion/dated}} will stop the proposed deletion process, but other deletion processes exist. In particular, the speedy deletion process can result in deletion without discussion, and articles for deletion allows discussion to reach consensus for deletion. Slon02 (talk) 20:44, 20 July 2011 (UTC)Reply

Speedy deletion nomination of F1teksolutions

edit
 

A tag has been placed on F1teksolutions, requesting that it be speedily deleted from Wikipedia for multiple reasons. Please see the page to see the reasons. If the page has since been deleted, you can ask me the reasons by leaving a message on my user talk page.

If you think that this notice was placed here in error, contest the deletion by clicking on the button labelled "Click here to contest this speedy deletion," which appears inside of the speedy deletion ({{db-...}}) tag (if no such tag exists, the page is no longer a speedy delete candidate). Doing so will take you to the talk page where you will find a pre-formatted place for you to explain why you believe the page should not be deleted. You can also visit the the page's talk page directly to give your reasons, but be aware that once tagged for speedy deletion, if the page meets the criterion, it may be deleted without delay. Please do not remove the speedy deletion tag yourself, but don't hesitate to add information to the page that would render it more in conformance with Wikipedia's policies and guidelines. If the page is deleted, you can contact one of these administrators to request that the administrator userfy the page or email a copy to you. Slon02 (talk) 20:49, 20 July 2011 (UTC)Reply

Speedy deletion nomination of Phpsolutions

edit
 

If this is the first article that you have created, you may want to read the guide to writing your first article.

You may want to consider using the Article Wizard to help you create articles.

A tag has been placed on Phpsolutions requesting that it be speedily deleted from Wikipedia. This has been done under section A7 of the criteria for speedy deletion, because the article appears to be about web content, but it does not indicate how or why the subject is important or significant: that is, why an article about that subject should be included in an encyclopedia. Under the criteria for speedy deletion, such articles may be deleted at any time. Please see the guidelines for what is generally accepted as notable.

If you think that this notice was placed here in error, contest the deletion by clicking on the button labelled "Click here to contest this speedy deletion," which appears inside of the speedy deletion ({{db-...}}) tag (if no such tag exists, the page is no longer a speedy delete candidate). Doing so will take you to the talk page where you will find a pre-formatted place for you to explain why you believe the page should not be deleted. You can also visit the the page's talk page directly to give your reasons, but be aware that once tagged for speedy deletion, if the page meets the criterion, it may be deleted without delay. Please do not remove the speedy deletion tag yourself, but don't hesitate to add information to the page that would render it more in conformance with Wikipedia's policies and guidelines. If the page is deleted, you can contact one of these administrators to request that the administrator userfy the page or email a copy to you. Slon02 (talk) 20:53, 20 July 2011 (UTC)Reply

July 2011

edit

  Please stop your disruptive editing. If you continue to add soapboxing, promotional or advertising material to Wikipedia, as you did at Phpsolutions, you may be blocked from editing. Waterfox ~talk~ 21:05, 20 July 2011 (UTC)Reply

Your contributed article, How to create custom plugins in Zend Framework

edit
 

If this is the first article that you have created, you may want to read the guide to writing your first article.

You may want to consider using the Article Wizard to help you create articles.

Hello, I notice that you recently created a new page, How to create custom plugins in Zend Framework. First, thank you for your contribution; Wikipedia relies solely on the efforts of volunteers such as you. Unfortunately, the page you created covers a topic on which we already have a page - Zend Framework. Because of the duplication, your article has been tagged for speedy deletion. Please note that this is not a comment on you personally and we hope you will continue helping to improve Wikipedia. If the topic of the article you created is one that interests you, then perhaps you would like to help out at Zend Framework - you might like to discuss new information at the article's talk page.

If you think that the article you created should remain separate, contest the deletion by clicking on the button labelled "Click here to contest this speedy deletion," which appears inside of the speedy deletion ({{db-...}}) tag (if no such tag exists, the page is no longer a speedy delete candidate). Doing so will take you to the talk page where you will find a pre-formatted place for you to explain why you believe the page should not be deleted. You can also visit the the page's talk page directly to give your reasons, but be aware that once tagged for speedy deletion, if the page meets the criterion, it may be deleted without delay. Please do not remove the speedy deletion tag yourself, but don't hesitate to add information to the page that would render it more in conformance with Wikipedia's policies and guidelines. If the page is deleted, you can contact one of these administrators to request that the administrator userfy the page or email a copy to you. Additionally if you would like to have someone review articles you create before they go live so they are not nominated for deletion shortly after you post them, allow me to suggest the article creation process and using our search feature to find related information we already have in the encyclopedia. Try not to be discouraged. Wikipedia looks forward to your future contributions. Safiel (talk) 02:38, 21 July 2011 (UTC)Reply