zend-framework

What's the best way to handle something like a login page on top of Zend Framework? (And why does my implementation explode?)

落花浮王杯 提交于 2020-01-03 16:43:24
问题 EDIT: Sorry for the large amount of code here; I'm not sure exactly what's going on so I included more to be safe. I've currently got a login page which farms out to a central authentication service. I'd like to do a permissions check on the user. If the user is not logged in, I'd like to redirect them to the login page, and have the login page redirect them to do whatever action it was they were originally doing, running the access check again. If they don't have permission, I want to

Zend Framework generate unique string

元气小坏坏 提交于 2020-01-03 13:07:43
问题 I want to generate a unique 4-6 char long AlphaNumeric string to save in db with each record(user). The db field has a unique index, so trying to save a pre-existing string generates an error. Right now I am generating a random string and using try-catch, so when adding a new record if it throws an exception, I generate another random string and attempt to save again, and the code keep trying until it adds a record successfully. This whole solution not only looks heavy but also ugly, so I

How to check if user is logged with Zend Framework?

被刻印的时光 ゝ 提交于 2020-01-03 11:47:29
问题 I'm learning Zend Framework, but I have some doubts about the usage and the concepts. I want to check if the user is logged to allow access to all the pages. If it is, show the page, if not, display the login the page. My main doubts are what I need to use to do this (Zend_Auth, Zend_Acl, etc) and where to check if the user is logged (in each controller or the framework automatically checks this for each requisition). 回答1: The tool you want to use is Zend_Auth which is quite easy to use when

Content type-error when using Zend_Http_Client

守給你的承諾、 提交于 2020-01-03 10:26:07
问题 I'm trying to send data to Google Analytic's collector with Zend_Http_Client and POST. I have an array $postParams that's including my tracking-ID, cid and hit types and I add the values of this array to my client via setParameterPost() . Here's the relevant part of my Action: $client = new Zend_Http_Client('https://ssl.google-analytics.com/debug/collect'); foreach ($postParams as $postParam => $postValue) { $client->setParameterPost($postParam, $postValue); } $response = $client->request();

generate-migrations-diff failing with Zend framework

只愿长相守 提交于 2020-01-03 06:32:33
问题 I am trying to generate a migration script using Doctrine with Zend Framework. I am getting the following: $ php doctrine.php generate-migrations-diff $ PHP Fatal error: Cannot redeclare class Avo_Model_AccessType in $ tmp/fromprfx_doctrine_tmp_dirs/AccessType.php on line 16 I can successfully build the models form the yaml file. I am using Zend Framework 1.10.5 and Doctrine 1.2.2 I think the issue might be with the autoloader and the fact that Zend Autoloads the classes that doctrine is

Zend framework 2 PDF generation [closed]

南楼画角 提交于 2020-01-03 06:30:12
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I want to crate single A5 PDF document with 24 pages , There is no need to account for slugs or bleed , What is the Best Zendframwork 2 PDF generation Module for this ? Do you have tutorials or example pleas send me the links thank you .. 回答1: I use TCPDF. To get it up and running within your Zf2 installation

Zend Framework in a subfolder

十年热恋 提交于 2020-01-03 06:06:00
问题 I have installed a Zend Framework application in a subfolder, something like this: www.mydomain.com/temp/zend-application/ Now the problem is all stylesheets, javascript files and also all links use relative paths, such as: /css/styles.css /js/jquery.js /controller/action And these go to the main domain like this: www.mydomain.com/css/styles.css www.mydomain.com/js/jquery.js www.mydomain.com/controller/action So how to make it work in that subfolder? My .htacces file looks like this now:

Zend Form Validating of required elements

五迷三道 提交于 2020-01-03 05:56:10
问题 I have the required element in my Zend Form: $name = new Zend_Form_Element_Text('name'); $name->setLabel('Name') ->setValue(isset($plan)?$plan['name']:'') ->setRequired() ->setAttribs(array('class' => 'required', 'maxlength' => 50)) ->addValidators(array(new Zend_Validate_StringLength(array('min' => 1, 'max' => 50)), new Zend_Validate_Db_NoRecordExists(array('table' => 'plan', 'field' => 'name'))) ->addFilters(array(new Zend_Filter_StringTrim, new Zend_Filter_StripTags)); All validators work

Set document root in Zend Framework 1.12.x application in Azure Cloud Service

断了今生、忘了曾经 提交于 2020-01-03 05:47:05
问题 in relation to my other question on how to set the document root for a Azure Web Site, I would like to know how to do the same with a Cloud Service. I've used the Azure Powershell Tools to create a package of my application and succesfully uploaded it to the cloud. But setting document root is not working. My ServiceDefinition.csdef looks like this: <?xml version="1.0" encoding="utf-8"?> <ServiceDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001

Execute MSSQL stored procedure via Zend Framework

自闭症网瘾萝莉.ら 提交于 2020-01-03 05:31:05
问题 Request: Please show me a working example of how to retrieve(in an array?) returned rows from a Stored Procedure on a MSSQL server using Zend Framework and passing parameters to the stored procedure. Explanation: I can't find anything in the ZF docs about how to execute SP on MSSQL servers. I'm aware that it is possible via plain PHP. However, since my project uses ZF, I'd like not to have to have extra code to open a connection to the server, etc. etc. Digging through the ZF code I see