zend-framework

zend framework custom validation classes

不问归期 提交于 2019-12-24 02:23:38
问题 I'm writing a custom validator that is going to check for the existence of an email such that if it already exists in the database, the form is not valid. I'm having a hard time figuring out helper paths and namespaces for custom Zend_Validation classes. I'd like to call the class My_Validate_EmailUnique but I keep getting error messages such as: there is an error exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'My_Validate_EmailUnique' was not found in the

Fetching the current country name using ip address in php [closed]

淺唱寂寞╮ 提交于 2019-12-24 02:18:42
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I have a dropdown in which i fetch country name from database and i want to select current country name based on there ip address in dropdown box 回答1: Use PHP GeoIP API. NOTE: you need to setup the Maxmind GeoIP

Zend Framework Path Problems

微笑、不失礼 提交于 2019-12-24 02:16:58
问题 All, I am just trying to view any page at all besides the “Welcome to Zend Framework” screen. I have downloaded the project from this tutorial: http://framework.zend.com/docs/quickstart/create-a-form (Zend Framework Quickstart) As far as I can tell, the paths are coming up correctly. I read this post: http://www.johnmee.com/2008/11/zend-framework-quickstart-tutorial-deploy-to-a-subdirectory-instead-of-web-root/ I think it may be a bit dated, as the bootstrap code is not as he describes. Does

Why is msgid_plural necessary in gettext translation files?

百般思念 提交于 2019-12-24 02:16:12
问题 I've read the GNU Gettext manual about Translating plural forms and see its example: #, c-format msgid "One file removed" msgid_plural "%d files removed" msgstr[0] "%d slika je uklonjena" msgstr[1] "%d datoteke uklonjenih" msgstr[2] "%d slika uklonjenih" Why is msgid_plural different from msgid, and doesn't that defeat the purpose of having translations be aware of plural forms? I'd think that I could do something like this (for English): #, c-format msgid "X geese" msgstr[0] "%d goose"

Zend Framework: Check if Zend View Placeholder isset

只谈情不闲聊 提交于 2019-12-24 02:13:07
问题 How can I check if a Zend View Placeholder isset before echo-ing it out? As I am wanting to prepend " - " to it before outputting it. I tried echo isset($this->placeholder('title')) ? ' - ' . $this->placeholder('title') : ''; But I got Fatal error: Can't use method return value in write context in D:\Projects\Websites\php\ZendFramework\LearningZF\application\layouts\scripts\layout.phtml on line 5 On a side note, how come when I got this error, why isn't it shown in the Error View Script? The

Zend_db update better error reporting

岁酱吖の 提交于 2019-12-24 01:54:40
问题 When I update a record, I'm using the result from 'update' to determine if it worked correctly. $a = $this->db->insert(self::TABLE, $saveData); $a = 1 means that it updated one record. $a = 0 means that it didn't update anything. I can get a 0 if there was nothing changed in the form. But I also assume I can get a 0 if there was an error. I'd like to be able to tell the user that the information was not updated because they didn't change anything or that there was an actual error of some sort

Zend Controller Action , get Helper in other class?

心已入冬 提交于 2019-12-24 01:48:11
问题 is there any way to get an Action Helper from an Service Class? I have the following Helper: class Helper_Host extends Zend_Controller_Action_Helper_Abstract { /** * Return Hosturl with path * * @return string Hostname */ public function direct() { $front = Zend_Controller_Front::getInstance(); $host = 'http://' . $_SERVER['HTTP_HOST']; $host .= $front->getBaseUrl() . '/'; return (string) $host; } } Now i want to get the Hostname from "My_Service_XYZ" , getStaticHelper is not working like

All Wordpress files are hacked. How to remove the encoded injection? [closed]

天大地大妈咪最大 提交于 2019-12-24 00:58:44
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . A friend asked me to look up why his WordPress site is not working at all. It turned out it's hacked. At the beginning of all PHP files an encoded string is injected, something like this: $zend_framework=" .... "; @error_reporting(0); $zend_framework("", "... I have checked the version of WordPress at /wp

Zend Framework not include the default module in url

寵の児 提交于 2019-12-24 00:48:21
问题 I have a ZF1.12 project with this structure: |Project |-Application |-configs |-application.ini |-modules |-default |-configs |-controllers |-models |-views |-Bootstrap.php |-api |-configs |-controllers |-models |-views |-Bootstrap.php |-Bootstrap.php |-Library |-Public module configuration in application.ini resources.modulesetup[] = resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" resources.frontController.defaultControllerName = "index" resources.frontController

Zend Framework: Post to different action then return to original action if fails validation AND keep form fields

前提是你 提交于 2019-12-24 00:28:50
问题 This might sound like an odd scenario, but I've got two forms on one page. One is just posting back to itself. I made the second post to another action to keep the code cleaner. Maybe not the right choice... The problem I'm having now is that if that second form doesn't validate, I redirect back to the page with the form but I don't know how to keep my form fields filled in with the original information the user entered. Is there a way to do that and keep posting to two separate actions, or