zend-framework

Zend & method=“put”

自作多情 提交于 2019-12-12 00:55:58
问题 My app seems to be completely ignoring the PUT action. I have a controller with GET, POST, PUT and DELETE actions using REST. Both PUT and DELETE methods seem to be ignored. Perhaps it's an action and method syntax issue? Anyway here is some sample code: public function init() { // Set the method for the display form to PUT $this->setMethod('PUT'); $this->setAction('/article/?update'); } From Controller: public function putAction() { echo "putAction";exit(); } In my .htaccess I also allow

Zend Locale & Zend_Currency: Region code

天大地大妈咪最大 提交于 2019-12-12 00:44:03
问题 I am trying to create a connection between the Zend_Locale and the Zend_Currency using the browser language preferences. BROWSER: en $locale = new Zend_Locale(Zend_Locale::BROWSER); Zend_Debug::Dump($locale->getLanguage()); Zend_Debug::Dump($locale->getRegion()); die; Result: string(2) "en" bool(false) BROWSER: en_US $locale = new Zend_Locale(Zend_Locale::BROWSER); Zend_Debug::Dump($locale->getLanguage()); Zend_Debug::Dump($locale->getRegion()); die; Result: string(2) "en" string(2) "US" Ho

How mvc works in Zend framework

不羁的心 提交于 2019-12-12 00:33:56
问题 Thanks for previous replies.. I am trying to print Hello_world using zend framework. I wrote php file in model folder and return string value as a "Hello_world". In controller i access the value of PHP like this $value = new TextReturner(); $this->view->setValue = $value->hello_world(); . i dont know how to access the value from controller to the view php file. I am new to zend framework. I already go through the outline structure of zend framework, i dont know how to access through codings.

How to get datetime in words like “today”, “yesterday” or “25 minutes ago”? [duplicate]

烈酒焚心 提交于 2019-12-12 00:33:41
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: How do I calculate relative time? How to display “12 minutes ago” etc in a PHP webpage? I have date formats like this: 2011-09-10 12:00:00 2011-09-12 11:02:05 2011-09-12 I want to create a function that will get a date and will output something like this ? 5 minutes ago 2 hours ago today yesterday and show date if date is far away. Is there any related function in php or any free already written library. Thanks

testing zend with phpunit gives me “The mysql driver is not currently installed”

家住魔仙堡 提交于 2019-12-11 23:55:59
问题 i have this testing class <?php class IndexControllerTest extends ControllerTestCase { .... public function testValidLoginShouldGoToProfilePage() { $this->request->setMethod('POST') ->setPost(array( 'email' => 'capoarea', 'password' => '123456' )); $this->dispatch('/user/login'); $this->assertRedirectTo('/index/index'); $this->resetRequest() ->resetResponse(); $this->request->setMethod('GET') ->setPost(array()); $this->dispatch('/cliente/index'); $this->assertRoute('default'); $this-

Accessing Google Spreadsheet with Zend without Authentication

寵の児 提交于 2019-12-11 23:48:14
问题 I am attempting to access a public spreadsheet that does not require authentication to access. I am following the guidance found on this page to access the spreadsheet, however, the docs specify how to do it using an authenticated user. There does not seem to be any guidance on accessing public spreadsheets without authentication. So, does anyone have any suggestions how to go about doing this? 回答1: In my experience with google spreadsheets you can just leave the authentication blank if it's

how to redirect a page through controller in zend

一曲冷凌霜 提交于 2019-12-11 23:44:43
问题 When I click on a submit button i want the page to redirect to the following page? header('Location: /pdp/policy-info.phtml'); I wrote the above code in the controller code but I am not able to redirect to the above page. it stays on the same page. the filename is called policy-info.phtml in the view. Also once I redirect, would I be able access my form values through $_POST? Or is there an alternative. 回答1: ok it sounds to me like you may be missing a few concepts: You will never redirect to

Query all groups of a user using Zend_Ldap

走远了吗. 提交于 2019-12-11 23:40:59
问题 I haven't really got much to show because I'm not overly familiar with ldap (Open Directory) at all and I'm having a bit of trouble understanding how to actually query the groups of a particular user. Using Zend_Auth_Adapter_Ldap(), $ldap = array( array('host' => 'od-master.foobar.net', 'baseDn' => 'cn=users,dc=foobar,dc=net', 'bindRequiresDn' => true, 'accountCanonicalForm' => 2)); $authAdapter = new Zend_Auth_Adapter_Ldap($ldap); // Set the input credential values to authenticate against

Moving Zend Framework site to new host - “An error occurred Page not found”

ⅰ亾dé卋堺 提交于 2019-12-11 23:34:16
问题 I'm new to ZF and having issues moving a currently live site to a new host. The new host is running on a temporary dev URL using the IP and username as the domain. When I attempt to navigate directly to the index.php page that (I think) runs the site, I get a 404. Is there an issue with the site not having an true domain yet? Is ZF setup to check the path/domain is was originally setup on and now it's not finding that domain? The currently LIVE site is setup in a subdirectory called /share/ .

Facing Issue in zend_search_lucene

两盒软妹~` 提交于 2019-12-11 23:26:23
问题 I am using Zend Lucene Search: ...... $results = $test->fetchAll(); setlocale(LC_CTYPE, 'de_DE.iso-8859-1'); Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8()); foreach ($results as $result) { $doc = new Zend_Search_Lucene_Document(); // add Fields $doc->addField( Zend_Search_Lucene_Field::Text('testid', $result->id)); $doc->addField( Zend_Search_Lucene_Field::Keyword('testemail', strtolower(($result->email)))); $doc->addField( Zend_Search