zend-framework

Zend Framework , Model Class not found in Module

别等时光非礼了梦想. 提交于 2019-12-10 11:57:24
问题 I've Created an application with these details : 1- zf create project MyApp 2- zf create module admin 3- zf create controller Index 1 admin MyApp/application/modules/admin/controllers/IndexController.php : class admin_IndexController extends Zend_Controller_Action { public function init() { error_reporting(E_ALL); ini_set('display_errors', 'On'); } public function indexAction() { $aa = new Admin_Model_DbTable_Posts(); } } application.ini : [production] phpSettings.display_startup_errors = 0

Access to database zend framework

我与影子孤独终老i 提交于 2019-12-10 11:46:13
问题 I want to access to database "mysql", I read that we can define the db adapter and db configurations by writing these lines in application.ini file resources.db.adapter = MYSQLI resources.db.params.host = localhost resources.db.params.username = root resources.db.params.password =123456 resources.db.params.dbname = visits_db I want to get the $db object in order to use in for executing sql statements $db->insert("inspection_visits_tb", $insepctionVisitData = array( 'day' => $visit->getDay(),

Correct way to deal with application-wide data needed on every pageview

给你一囗甜甜゛ 提交于 2019-12-10 11:44:22
问题 I am currently involved in the development of a larger webapplication written in PHP and based upon a MVC-framework sharing a wide range of similarities with the Zend Framework in terms of architecture. When the user has logged in I have a place that is supposed to display the balance of the current users virtual points. This display needs to be on every page across every single controller. Where do you put code for fetching sidewide modeldata, that isn't controller specific but needs to go

Update a record through model in zend framework

别来无恙 提交于 2019-12-10 11:41:42
问题 I am having a model and would need to update the record. every time $count ($count = $post->save()) is being NULL . how is it possible to know whether this record saved or not. if saved, i want to display the following message 'Post updated' and if not the other message 'Post cannot update'. This is always going to the else port. how can i know model updated correctly or not? $post = new Application_Model_Post($form->getValues()); $post->setId($id); $count = $post->save(); //var_dump($count);

How to determine if a web application has been installed and set up?

帅比萌擦擦* 提交于 2019-12-10 11:33:36
问题 I am not sure to be enough be by my question... Well i'm developping a CMS in PHP with Zend Framework. I would like to have a nice web gui to install and set up the application after unpacked it somewhere... Some CMS or whatever the application is, offer this way to do by simply entering an 'install url' like 'http://localhost/app/install' I'd like to do the same but i don't want to let any users to set it up, so i am looking for a way to determine if the application has been set up or no.

Zend Framework: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'

◇◆丶佛笑我妖孽 提交于 2019-12-10 11:32:11
问题 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

Zend framework form Decorators

夙愿已清 提交于 2019-12-10 11:09:22
问题 i am trying to get the following layout using decorators: <form action="/index/login" method="post" id="login_form"> <div class="input_row"> <img src="/images/user_icon.png" class="login_icon" alt=""/> <label for="username" class="login_label">Username:</label> <input type="text" name="username" value="" id="username" class="login_input" /> </div> <div class="input_row"> <img src="/images/password_icon.png" class="login_icon" alt=""/> <label for="password" class="login_label">Password:</label

Secure shared Google Calendar

醉酒当歌 提交于 2019-12-10 11:07:09
问题 I am working on a small scale website. It has a very simple idea, there are two sets of users, office and workers, both have to login to acess the site (the site is built with the Zend framework) . The problem: I want to have a calendar which is accessible by all the users. The office staff being able to edit the calendar and the workers only being able to view the calendar. I really want to user google as the backend for the calendar due to its flexibility: A couple of the office workers

Need Help in zend framework URL Rewrite

。_饼干妹妹 提交于 2019-12-10 10:54:48
问题 I need help in URL rewrite in zend framework. If I print below URL : echo $this->url(array('controller'=>'guestbook','action'=>'edit','id'=>$entry->id), null, TRUE); It will generate url like : http://localhost/guestbook/public/index.php/guestbook/edit/id/1 But How can I generate url like : http://localhost/guestbook/public/index.php/guestbook/edit/1 in zend framework? I don't want 'id' in URL. Please Help. 回答1: To make it work you need to define a custom route, called e.g. guestbook, and

Inner join in Zend framework

故事扮演 提交于 2019-12-10 10:54:29
问题 I want to make inner join between two tables Visit table has visit_id target Report table has rep_id visit_id Each visit has many reports ,I want to select all reports with specified visit target I make like this but it donesn't work $db = Zend_Db_Table::getDefaultAdapter(); $select = $db->select(); $rows = $select->from('visits_tb', array('target', 'visit_id')) ->joinInner('report_tb', 'visits_tb.visit_id= report_tb.visit_id', array('visit_id', 'rep_id')) ->where("visits_tb.visit_id=$id");