zend-framework

Multiple Conditions with Left Join in Zend Framework

允我心安 提交于 2019-12-10 19:03:48
问题 I am facing an issue while working with Zend Framework. Basically I am trying to add an AND operator in a sub query using Left join. Please see the following qyery that my code is producing, SELECT d .*, count(status) FROM deal AS d LEFT JOIN payments ON payments .deal_id = d .deal_id GROUP BY d . deal_id ORDER BY created_date desc Code is: $select = $this->_db->select() ->from(array('d'=>'deal')) ->joinLeftUsing('payments', 'deal_id', array('count(status)')) ->order("created_date $sortOrder"

Zend_Auth fails to write to storage

谁说我不能喝 提交于 2019-12-10 19:02:00
问题 I have yet another weird annoying thing going on with Zend. Basically, I have the following code after creating a user domain: $this->auth = Zend_Auth::getInstance(); $this->view->user = $this->user = $this->auth->getIdentity(); $this->user->idSite = $idSite; $this->user->urlSite = $urlSite; $this->auth->getStorage()->write($this->user); What FURIOUSLY annoys me is that the auth->getIdentity() just moments after that: [idSite] => 0 [urlSite] => So from here it gets worse: If I REFRESH or if

Routing for country , province , city , product in Zend Framework

*爱你&永不变心* 提交于 2019-12-10 18:56:15
问题 This url structure is proposed for SEO optimization. So suggesting another structure will not work. Structure proposed is example.com/<language>/<country>/<province>/<city>/<product> example.com/en/spain I wish to point to CountryController indexAction , as view of each one is different, and sometimes think there is change in layout also. Show the content in English language about the country Spain. And for a request example.com/en/india should show about India in English language and example

Zend Module Bootstrap does not load

柔情痞子 提交于 2019-12-10 18:51:55
问题 I have a very strange case where my Module is working but my Module's boostrap is not being loaded. Here is the segment in my application.ini for module autoloading: resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" resources.modules[] = "" Here is the bootstrapper: protected function _initAutoload() { $autoloader = new Zend_Application_Module_Autoloader(array( 'namespace' => 'User_', 'basePath' => APPLICATION_PATH .'/modules/user', 'resourceTypes' => array ( 'model' =>

.htaccess not working

好久不见. 提交于 2019-12-10 18:24:42
问题 I have done a fresh installation of xampp , after installing the folder containing following htaccess file is not showing in my browser. SetEnv APPLICATION_ENV development RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] it gives 500 error and the server is overloaded This happens when I am trying to execute the public folder in my zend application.

Zend_Session doesn't allow you to destory and recreate a session

雨燕双飞 提交于 2019-12-10 18:12:27
问题 My requirement is, When user agent change session should destroy, and it should start new session. But Zend_Session::start() is throwing an exception if destroy was called before start(). try { Zend_Session::start(); } catch (Zend_Session_Exception $e) { Zend_Session::destroy(true); Zend_Session::start(); // breaking here Zend_Session::regenerateId(); } Zend_Session::registerValidator(new Zend_Session_Validator_HttpUserAgent()); Exception: Uncaught exception 'Zend_Session_Exception' with

Zend_Dojo_Form in a layout

早过忘川 提交于 2019-12-10 17:56:57
问题 I have a Zend_Dojo_Form which I have moved from my view (where it works fine) to my layout, as it's something that will be useful on every page. However in the layout the form no longer works - none of the dijit elements appear and it behaves just as a normal HTML form would. Here's the relevant part of my bootstrap: protected function _initView() { Zend_Layout::startMvc(array( 'layoutPath' => '../application/layouts', 'layout' => 'default' )); $view = new Zend_View(); $view->setEncoding('UTF

'Zend_Db_Statement_Exception' with message 'Invalid bind-variable name ':1'

雨燕双飞 提交于 2019-12-10 17:43:22
问题 Good day, Background Info: Client's hosting server is being upgraded from PHP 5.2 to PHP 5.3. The client's app breaks when tested on PHP 5.3. Specifically the insert and update methods are the ones which are breaking the app. The app coded in Zend Framework v1.7.2. We have tried simply upgrading the Zend Framework core, however it seems that the previous developers made changes to the core, which causes the app to completely break when the framework has been upgraded. Problem The best

Zend_Db_Table_Row: Why do I have to use createRow()?

拜拜、爱过 提交于 2019-12-10 17:37:42
问题 I'm wondering why in Zend_Db you have to use the createRow method to get a new, empty Row object, rather than just instantiating the Row object directly. For instance, if I've extended the default classes to create my own User table and row classes, then in order to create a new row object I always have to do the following to create a new Row object: $userTable = new App_Table_User(); $userRow = $userTable->createRow(); $userRow->setName('bob'); $userRow->save(); But to me it makes more sense

Zend Framework : Subdirectories in controllers directory

妖精的绣舞 提交于 2019-12-10 16:45:45
问题 I'm using the Zend Framework for my website, and just created a special module "api" to create... Well, an API. Now, I have a lot of controllers in my module and I'd like to create subdirectories in this controllers directory in order to "tidy" it. My new structure would be something like this : - controllers/ - controllers/contents/[controllers] - controllers/users/[controllers] - controllers/misc/[controllers] However, I find myself totally unable to find what kind of urls and redirections