zend-framework

Fatal exception in loading ini file

牧云@^-^@ 提交于 2019-12-06 09:33:24
My project folder is demo, inside which I have the folders application, library and public. Inside the application folder, I have a folder named configs, inside which I have a file 'application.ini', which contains my database parameters. So, in the bootstrap.php which is in application directory, I set my database in Zend registry in a function called _initDbAdapter : $config = new Zend_Config_Ini('/demo/application/configs/application.ini', 'development'); Zend_Registry::set('config', $config); $db = Zend_Db::factory($config, $config->resources->db->params->asArray()); Zend_register('db',

zend framework FlashMessenger problem

血红的双手。 提交于 2019-12-06 09:32:54
i am using FlashMessenger helper to set messages, but i am unable to retrieve messages using getMessages() method. it returns null. here is my sample code: <?php class Admin_TestController extends Zend_Controller_Action { protected $_flashMessenger = null; public function init() { $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger'); $this->initView(); } public function myAction() { $this->_flashMessenger->addMessage('test message'); $this->_helper->Redirector("mynextrequest"); } public function mynextrequestAction() { zend_debug::dump($this->_flashMessenger->getMessages());

.htaccess redirect folder

﹥>﹥吖頭↗ 提交于 2019-12-06 09:20:08
All, I want to redirect all traffic that comes to http://mysite/ to http://mysite/public folder. Currently I am doing this using the below in an .htaccess file and it works for the root directory. But if I browse to http://mysite/application , it doesn't redirect and shows the directory listing. I want all traffic regardless of what folder it is to redirect to http://mysite/public folder RedirectMatch permanent ^/*$ /public/ Thanks Try this mod_rewrite example: RewriteEngine on RewriteRule !^public/ /public%{REQUEST_URI} [L,R=301] I see that you're using Zend Framework. Zend uses 'public' as

How to reset a Zend rememberMe function on each automatic login?

≯℡__Kan透↙ 提交于 2019-12-06 09:15:46
问题 I am using a remember me checkbox implemented with a Zend rememberMe function for automatic login. I have written this condition inside the controller for login, but I want it to reset to 7 days on each automatic login (as long as the current login is an automatic one). $seconds = 60 * 60 * 24 * 7; // 7 days Zend_Session::rememberMe($seconds); Is there a default zend function to update the cookie during each access. Btw, I'm new to coding. Hope someone can help me out. Thanks. 回答1: You wouldn

How to correctly set up exception handler in Zend?

假装没事ソ 提交于 2019-12-06 09:12:03
I'm trying to redefine exception handler for a couple of my controllers in Zend (RESTful). This is my piece of code: abstract class RestController extends Zend_Rest_Controller { public function init() { set_exception_handler(array($this, 'fault')); } public function fault($exception = null, $code = null) { echo $exception->getMessage(); } } But for some reason Zend uses default template/error handling and my fault function didnt execute. Btw, I'm using module architecture. that controller is from rest module.. Zend's default error handler is from default module. This is an interesting question

Zend <dt> <dd> decorators: what do I lose by removing them

人盡茶涼 提交于 2019-12-06 09:08:52
This question is specific to Zend_Form. Zend_Form adds standard decorators such as <dd> <dt> <dl> . What do I lose if I were to remove them? Are they used by Zend_Form itself for error reporting or any other reason? They are solely for structuring the output of your Zend Form elements in a definition list. Whether your form renders errors is controlled through the Error Decorator. See this series of articles by Matthew Weier O'Phinney: The simplest Zend Form Decorator How to layer Decorators Rendering Zend Form Decorators individually Creating composite elements and Rob Allen's Zend_Form

Zend Framework: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 08:56:25
As you may have known that I switched from ubuntu to windows from my previous questions. I was working on Zend Framework on ubuntu and now working on same project in windows. Because of this switching I am facing some problems in windows which was not occurred in ubuntu. Now I have the following error in firebug console when I go to login page: <b>Fatal error</b>: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' in <b>C:\wamp\www\vcred\library\Zend\Db\Adapter\Pdo\Mysql.php</b> on line <b>93</b><br /> Do you people know that what type of error is this and what is the solution? I have the

Zend_Rest_Route and hierarchical routes

混江龙づ霸主 提交于 2019-12-06 08:56:16
Using Zend 1.9, I am trying to use Zend_Rest_Route to implement hierarchical url. So I have 2 restFul controller ( users and items ) and invoke the second controller using hierarchical routes. Example: (consider GET http verb) http://example.org/users/ //this point to indexAction of usersController http://example.org/users/234 //this point to getAction of usersController http://example.org/users/234/items //this point to indexAction of itemsController http://example.org/users/234/items/34 //this point to showAction of itemsController Example: (consider POST http verb) http://example.org/users/

What are good resources for learning the Zend framework? [closed]

跟風遠走 提交于 2019-12-06 08:54:40
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . What's an efficient way for someone who knows PHP and Ruby on Rails to quickly pick up the Zend framework? 回答1: I think that by

zend framework rest controller question

◇◆丶佛笑我妖孽 提交于 2019-12-06 08:41:45
I have a rest controller example im trying to run that is giving me a headache. My url im trying to access is localhost/books/edit/1 For some weird reason this route seems to call the getAction with the Controller instead of the editAction. And it throws errors saying that the object doesnt exist. The controller is, class BooksController extends Zend_Rest_Controller { private $_booksTable; private $_form; public function init() { $bootstrap = $this->getInvokeArg ( 'bootstrap' ); $db = $bootstrap->getResource ( 'db' ); $options = $bootstrap->getOption ( 'resources' ); $dbFile = $options ['db']