zend

How can I reduce my Class Name in Zend to call it from any where in application?

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to follow Zend file naming convention . I have Object.php file with a class and a function in it. MyZendProject->application->models->Test->Object.php class Model_Test_Object { public function test() { echo "Test"; } } Now I want to access above test function in following file but it is not finding it. MyZendProject->application->modules->test->controllers->TestController.php $testModel = new Model_Test_Object(); $testModel->test(); But when I name the class Application_Model_Test_Object in Object.php and call it in TestController

Zend Framework: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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

cross-compiled THTTPD server with PHP runs fine, but no PHP

匿名 (未验证) 提交于 2019-12-03 08:56:10
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We need some PHP on an ARM board. I've successfully cross-compiled both PHP 5 and THTTPD and they both seem to run fine on the ARM board, only the .php pages are shown unprocessed (if you do "View Source" in the web browser, you can see the PHP code). It has to be a silly configuration detail, I really feel that I am snatching defeat from the jaws of victory. Any help or smart ideas would be greatly appreciated! Here are my steps to build, deploy and test: My thttpd.conf file is: dir=/srv/www phppat=** phpspat=**.php logfile=/srv/www/logs

How to fix, &#039;PHP&#039; make, in Mac OS X (10.9.4)?

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm adding postgres support to PHP on OS X Mavericks (10.9.4). Followed steps from [blog] ( http://blog.rupey.org/post/63221360055/adding-postgres-support-to-php-on-os-x-mavericks )... fixed in between errors, and, reached till 'make'. While performing 'make' I get the below error. ------ERROR------ users-mbp:pdo_pgsql RK$ pwd /usr/include/php/ext/pdo_pgsql users-mbp:pdo_pgsql RK$ make /bin/sh /usr/include/php/ext/pdo_pgsql/libtool --mode=compile cc -I/usr/include/php/ext -I. -I/usr/include/php/ext/pdo_pgsql -DPHP_ATOM_INC -I/usr/include/php

zf2 make a join between two different databases

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to make a join between two tables placed in different databases with Zend Framework 2. The first table is called users and is stored in the database admin The second table is called hierarchy and is stored in the database customer I load the databases adapters in global.php return array( 'admin' => array( 'driver' => 'Pdo', 'dsn' => 'mysql:dbname=admin;host=localhost', 'driver_options' => array( PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'' ), ), 'customer' => array( 'driver' => 'Pdo', 'dsn' => 'mysql:dbname=customer;host

where magento stores country full name

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have spent hours searching to find where magento stores full county name. We can get a full list of countries using this code: $_countries = Mage :: getResourceModel ( 'directory/country_collection' ) -> loadData () -> toOptionArray ( false ); This will return an array with country code and name, I investigated the directory module, and found out this call gets data from the table directory_county But this table don't have full county name! So where is it stored? and how is it retrieved using that call? Thanks in advance. 回答1: Ok

Set Zend\\Form Error Messages from Controller

匿名 (未验证) 提交于 2019-12-03 08:44:33
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: this is probably a very simple task, but currently I'm failing horribly at it. I just want to add a custom error to my form when my authentication fails. What i tried $form->setMessages(array( array('password' => $this->failedLoginMessage) )); Unexpected Result \Zend\Debug\Debug::dump($form->getMessages()); array(0) {} If i understand the code correctly this should attach an error message to the password element. Actually looking at the setMessages i thought attaching a single-dimension array should have been enough, but it needs the 2nd

Zend form setRequired(true) or addValidator(NotEmpty)

匿名 (未验证) 提交于 2019-12-03 08:35:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there any real difference between the behavior or output of these 2. They look to me like they do the same thing. ->addValidator('NotEmpty') ->setRequired(true) 回答1: Yes, there's a difference. If an element is not required, it'll validate even if the whole value is missing from the data you validate against. The value is only validated against registered validators after it's been determined that it exists. NotEmpty validator will only fail if the field is present, but is empty. Also, it's not necessary to add NotEmpty validator yourself,

ZF2 detach listener from EventManager

匿名 (未验证) 提交于 2019-12-03 08:30:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Implementing a new ZF2 app I found myself struggling with the EventManager. In the application module I created an AuthenticationListener and a NotifierListener . The first checks for proper authentication on users and the second displays custom messages addressed to the logged user. Now I'm creating a new module that dispatches xml files to export. I want to keep the AuthenticationListener but detach the NotifierListener to avoid E_NOTIFY errors. The problem is that after reading blogs/source code/documentation (pretty poor) and pulling my

Zend Framework 2 抢先体验

倖福魔咒の 提交于 2019-12-03 06:48:48
新一代的PHP框架Zend Framework 2 诞生了,它基于Zend Framework 1,仅支持PHP 5.3,它将在未来一年里取代其旧版本。 初探 因为熟悉Zend Framework 1,我决定进入2.x beta版本,看看有什么变化,并测试对已有的程序是否有影响。 Rob Allen写过一个 教程 很适合那些从没用过Zend Framework框架的人。你可以通过git克隆(或下一个zip包)来安装框架,并增加一些应用模块。 如果你想玩一个已经写好的框架程序,那么一个包含了实现数据库表的CRUD模块的程序,比起仅仅是“HelloWorld”的程序要好很多。 框架之所以好,是因为它已经包含一些功能模块及.htaccess。所以你只需要在Apache上配置,就可以运行起来。以前,一个新手在创建程序之前都要先配置好Zend Framework 1,我不敢说第一次使用Zend_Tool和ZF都是那么简单。 现在让我们来看看新框架的变化 - 目录结构: Application/ config/ src/ views/ 每个模块代码(类)都是从配置和视图模板中分离的,而不是强迫分开于控制器、模型、服务和其他对象。 这也意味着,理论上你想去掉在一个应用模块,只需要去掉一个单独的文件夹。但这并不意味着模块之间没有关联,例如:两个步骤的视图布局,就可以指定使用其他的模块