zend-framework

Zend Framework 2 Segment Route matching 'test' but not 'test/'

老子叫甜甜 提交于 2019-12-24 19:27:08
问题 I have two modules Admin and Application. In the module application I have the following route in my module.config.php: 'admin' => array( 'type' => 'Segment', 'options' => array( 'route' => '/admin[/:controller[/:action]]', 'constraints' => array( 'controller' => '[a-zA-Z][a-zA-Z0-9_-]*', 'action' => '[a-zA-Z][a-zA-Z0-9_-]*', ), 'defaults' => array ( '__NAMESPACE__' => 'Admin\Controller', 'module' => 'Admin', 'controller' => 'Index', 'action' => 'index', ), ), 'may_terminate' => true, 'child

What is the proper syntax for describing a <SELECT> form element to Zend_Form using XML as the config?

时光毁灭记忆、已成空白 提交于 2019-12-24 19:23:09
问题 I am using an XML config file to tell Zend_Form what elements I want. I would like to have a <select> element, but I am unsure as to how to add <option> tags using the XML syntax. Sure I am missing something pretty basic. Ben 回答1: Programmatic forms in the ZF only support the parameters type, name and options (not in the meaning of choices but of element settings, like required or label) for the form elements. It is assumed that multiple values will be set dynamically, e.g: $formConfig = new

Netbeans AutoComplete Methods Zend Model Classes

我只是一个虾纸丫 提交于 2019-12-24 19:12:04
问题 I have the following models classes however netbeans 7.0.1 autocomplete doesn't work for row classes. Model Class: class Application_Model_DbTable_Payments extends Zend_Db_Table_Abstract { protected $_name = 'payments'; protected $_rowClass = 'Application_Model_Payment'; } Row Class: class Application_Model_Payment extends Zend_Db_Table_Row_Abstract { public function setIdentifier($identifier = null){ return $this->identifier = $identifier; } } Code: $paymentsModel = new Application_Model

How to add custom form element fckeditor in zend framework

假装没事ソ 提交于 2019-12-24 19:08:02
问题 I want to use fckeditor in my website using zend framework. Can any one explain how can we add custom form elements with zend framework ? 回答1: It is not the "good practice" here - to give a link, but I don't think this question can be answered better without copy-paste: http://www.leftcolumn.net/2009/03/10/zend-framework-how-to-add-fckeditor-to-a-zend_form/ http://www.zfsnippets.com/snippets/view/id/55 ps: I'm curious, why did not you google for first http://www.google.ru/search?q=zend+form

Connect to mysql server through ssl in Zend Framework

寵の児 提交于 2019-12-24 17:48:47
问题 Single DB connection (resource configuration) from application.ini : resources.db.adapter = "pdo_mysql" resources.db.params.host = "mysql1" resources.db.params.username = "dbuser" resources.db.params.password = "dbpass" resources.db.params.dbname = "dbname" ;resources.db.??? Multiple DB connection (resource configuration) from application.ini : resources.multidb.mysql1.adapter = "pdo_mysql" resources.multidb.mysql1.host = "mysql1" resources.multidb.mysql1.username = "dbuser" resources.multidb

symfony/zend integration - blank screen

好久不见. 提交于 2019-12-24 17:44:06
问题 I need to use ZendAMF on a symfony project and I'm currently working on integrating the two. I have a frontend app with two modules, one of which is 'gateway' - the AMF gateway. In my frontend app config, I have the following in the configure function: // load symfony autoloading first parent::initialize(); // Integrate Zend Framework require_once('[MY PATH TO ZEND]\Loader.php'); spl_autoload_register(array('Zend_Loader', 'autoload')); The executeIndex function my the gateway actions.class

Zend Framework 2 routing error: resolves to invalid controller class or alias

点点圈 提交于 2019-12-24 17:09:33
问题 I'm trying to learn Zend Framework 2 and I have their skeleton application up and running. In order to access it I visit http://localhost:8080/. When visiting that link it displays their generic Zend page. What I want to be able to do is visit http://localhost:8080/application/test and have it bring me to a different page with a different layout. Here is the module.config.php <?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework

how can I download a file with Zend_Http_Client or other library

雨燕双飞 提交于 2019-12-24 16:33:31
问题 I am trying to find a solution to get directly the file like wget does instead of reading from the stream and writing to another file, but I am not sure if this is possible. Any suggestions? 回答1: I also found copy which allows to copy a file from an url directly to your disk and is a oneliner without the complexity of curl or the need to create an empty file where to transfer the content of file_get_contents. copy($file_url, $localpath); 回答2: file_put_contents($local_path, file_get_contents(

How to use a data mapper with sql queries

早过忘川 提交于 2019-12-24 16:12:55
问题 I am having trouble understanding the datamapper design pattern. I have two queries (one to get albums and one to get artist). I want to produce a list of albums and artists (band members). There is a one to many relationship between the two. SQL Queries public function getArtist() { $adapter = $this->getAdapter(); $sql = new Sql($adapter); $select = $sql->select(); $select->from('genre'); $select->where(array( 'album_id' => $album,)); $selectString = $sql->getSqlStringForSqlObject($select);

How to rotate text while creating PDF in Zend Framework?

守給你的承諾、 提交于 2019-12-24 15:45:25
问题 I am placing text on pdf something like this using Zend_Pdf: $page1->drawText( 'Hello World!', 100, 100 ); But now I want to rotate text to 90 degree on pdf. How is it possible ?? Thanks 回答1: How about: $page->rotate(0, 0, M_PI/12); $page->drawText('Hello world!', 100, 100); See also: Zend PDF tutorial 回答2: You can use rotate() which uses Radians to determine the amount to rotate. For example: // Rotate at the X and Y coordinates // and 90 Degrees Counter-Clockwise (which is 1.5708 Radians)