zend-framework

Zf3 controller not able to access the model class table located in another module

寵の児 提交于 2019-12-22 12:12:12
问题 I am new to Zend Framework. Is there a way to access the model class table which is located in another module from my active controller? As its bye bye service locator in ZF3 i am not able to access the model class table located in other modules. Previously in ZF2 controller private configTable; public function getConfigTable() { if (!$this->configTable) { $sm = $this->getServiceLocator(); $this->configTable = $sm->get('Config\Model\ConfigTable'); // <-- HERE! } return $this->configTable; }

Zf3 controller not able to access the model class table located in another module

梦想与她 提交于 2019-12-22 12:11:06
问题 I am new to Zend Framework. Is there a way to access the model class table which is located in another module from my active controller? As its bye bye service locator in ZF3 i am not able to access the model class table located in other modules. Previously in ZF2 controller private configTable; public function getConfigTable() { if (!$this->configTable) { $sm = $this->getServiceLocator(); $this->configTable = $sm->get('Config\Model\ConfigTable'); // <-- HERE! } return $this->configTable; }

Saving a Zend date in the database with Doctrine 2.1

妖精的绣舞 提交于 2019-12-22 12:09:30
问题 I want to save a datetime in the database which was created with the doctrine schema tool. In my form I set a date and time and i want to save it as a datetime in the database. So i tried this: $e->setStartDateTime(new Zend_Date('2011-09-01T22:00:00',Zend_date::DATETIME)); But i get the error: PHP Fatal error: Call to undefined method Zend_Date::format() in /var/www/shared/Doctrine/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Types/DateTimeType.php on line 44 Does anyone have experience with

multiple instances of view helper plugin?

时光怂恿深爱的人放手 提交于 2019-12-22 11:46:51
问题 How do I instantiate multiple instances of a view helper plugin in Zend 2? I want to return a new instance every time I call $this->pluginName(); from the view. How do I return a new instance of the view plugin? 回答1: Add the service name to the getViewHelperConfig() shared configuration key in Module.php and set this value to false Module.php function getViewHelperConfig() { return array( 'shared' => array( 'MyViewHelper' => false, ), 'factories' => array( 'MyViewHelper' => 'App\View\Helper

PHP extension wrapper for C++ [closed]

感情迁移 提交于 2019-12-22 11:44:29
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I am new in this area of writing extension for PHP, however I need to create a wrapper class for C++ to PHP. I am currently using PHP 5.2.13. I read this

how can i set data from database in check box using form in zend framework 1.11

爱⌒轻易说出口 提交于 2019-12-22 11:23:29
问题 I have a one table name is task_master. I want to set all record into check box dynamically in zend. I see so many examples but i didn't found anything to fix it. Task master id name<br> 1 Index<br> 2 Add<br> 3 Edit<br> 4 delete<br> i have new in zend. have any suggestion about it. how can i set data from database in check box using form in zend. like following. read from database and create list of check box in view. 回答1: I am not able to make out much from the code that you have shared but

Zend Framework - Internet Explorer - phpsessid cookie issue

柔情痞子 提交于 2019-12-22 11:12:28
问题 I've created a Zend Framework Website App session intensive. It works great in Chrome and Firefox but it is not working in IE. The session resets every page in IE. Looking into the headers I find that IE browser is getting a different phpsessid cookie in every get or post within the same browser so the session is not working. In FF and Chrome the phpsessid cookie persists ok. Anyone knows why this can happend only in IE? I have this code in bootstrap.php: $generalSession = new Zend_Session

How to call a method before the method of requested controller is executed : magento

安稳与你 提交于 2019-12-22 11:04:14
问题 I want to call a method before the execution of every and each controller's method. I don't want to go and call the method in every method. I just want to call it from one place and it will be called before any method of any controller in magento. And I am sure we can do this but I don't know how it can be accomplished. Please provide your suggestions. Hope we can resolve this or may some expert guys already resolved this. Thanks. 回答1: You need to create an Observer that binds to the

How can I set gzip compression in zend framework website

心已入冬 提交于 2019-12-22 11:02:34
问题 I am new to zend. I have developed a website using zend framework. Now, I want to set gzip compression in my website. Would you please guide me step wise to implement this. Thanks in advance. kamal Arora 回答1: There are two methods to gzip output in your website. Using Webserver.If your webserver is apache you can refer here for a good documentation on how to enable mod_deflate on your server. Using zend framework. Try the following code which is from this website. Create a gzip compressed

Change Module Name in Zend Framework

心已入冬 提交于 2019-12-22 10:00:07
问题 ZF 1.9.6 Trying to change the module based on the user agent of the request. When I try to get the request object from the Front, I get NULL. Currently I'm trying to set the module name from the Bootstrap _initModule method I created. $front = Zend_Controller_Front::getInstance(); $request = $front->getRequest(); // This is NULL $request = new Zend_Controller_Request_Http(); $request->setModuleName('iphone'); $front->setRequest($request); However, when executed, it's still going to the