Search Results

Search found 24872 results on 995 pages for 'zend form sub form'.

Page 6/995 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Zend - unable to catch exception [closed]

    - by coder3
    This still throw an uncaught exception.. Any insight why this isn't working? protected function login() { $cart = $this->getHelper('GetCurrentCart'); $returnValue = false; if ($this->view->form->isValid($this->_getAllParams())) { $values = $this->view->form->getValues(); try { $this->goreg = $this->goregFactory->create($this->config->goreg->service_url); if ($this->goreg->login($values['username'], $values['password']) && $this->goregSession->isLoggedIn()) { $returnValue = true; } else { echo 'success 1'; } } catch (Exception $e) { echo 'error 1'; } catch (Zend_Exception $e) { echo 'error 2'; } catch (Zend_Http_Client_Exception $e) { echo 'error 3'; } } return $returnValue; }

    Read the article

  • Access denied error on select into outfile using Zend

    - by Peter
    Hi, I'm trying to make a dump of a MySQL table on the server and I'm trying to do this in Zend. I have a model/mapper/dbtable structure for all my connections to my tables and I'm adding the following code to the mappers: public function dumpTable() { $db = $this->getDbTable()->getAdapter(); $name = $this->getDbTable()->info('name'); $backupFile = APPLICATION_PATH . '/backup/' . date('U') . '_' . $name . '.sql'; $query = "SELECT * INTO OUTFILE '$backupFile' FROM $name"; $db->query( $query ); } This should work peachy, I thought, but Message: Mysqli prepare error: Access denied for user 'someUser'@'localhost' (using password: YES) is what this results in. I checked the user rights for someUser and he has all the rights to the database and table in question. I've been looking around here and on the net in general and usually turning on "all" the rights for the user seems to be the solution, but not in my case (unless I'm overlooking something right now with my tired eyes + I don't want to turn on "all" on my production server). What am I doing wrong here? Or, does anybody know a more elegant way to get this done in Zend?

    Read the article

  • Zend Framework cleaning default routes when adding other

    - by Renato Aquino
    I have the following problem with Zend Framework. My project has several controllers like Video,Category and Post. The VideoController has an Action called categorylist, so the default URL/Route becomes /video/categorylist Since the action requires 3 parameters I whant to add one simple route: $router->addRoute( 'categorylist', new Zend_Controller_Router_Route('categorylist/:category/:page/:per_page', array('controller' => 'video', 'action' => 'categorylist','page'=>1,'per_page'=>6,'category'=>1)) ); With this I got my URL like www.siteurl.com/categorylist/42/1/6 but, the View Helper URL got crazy, and every url for the other controllers I try to echo it´s redirected to the categorylist route. So when I try this: <?= $this->url(array("controller"=> "video", "action" =>"view",'category'=>1),null,true)?> The expected result its /video/view/category/1, but I got /categorylit only. I tryied to debug the default routes but I got an empty array. print_r($ctrl->getRouter()->getRoutes()); Does anyone have some clue about this wierd behavior? I´m using Zend Framework Version 1.9.7

    Read the article

  • Why does Zend discourage "floating functions"?

    - by kojiro
    Zend's Coding Standard Naming Convention says Functions in the global scope (a.k.a "floating functions") are permitted but discouraged in most cases. Consider wrapping these functions in a static class. The common wisdom in Python says practically the opposite: Finally, use staticmethod sparingly! There are very few situations where static-methods are necessary in Python, and I've seen them used many times where a separate "top-level" function would have been clearer. (Not only does the above StackOverflow answer warn against overuse of static methods, but more than one Python linter will warn the same.) Is this something that can be generalized across programming languages, and if so, why does Python differ so from PHP? If it's not something that can be generalized, what is the basis for one approach or the other, and is there a way to immediately recognize in a language whether you should prefer bare functions or static methods?

    Read the article

  • Why should I use Zend_Application?

    - by Billy ONeal
    I've been working on a Zend Framework application which currently does a bunch of things through Zend Application and a few resource plugins written for it. However, looking at this codebase now, it seems to me that using Zend_Application just makes things more complicated; and a plain, more "traditional" bootstrap file would do a better job of being transparent. This is even more the case because the individual components of Zend -- Zend_Controller, Zend_Navigation, etc. -- don't reference Zend_Application at all. Therefore they do things like "Well just call setRoute and be on your way," and the user is left scratching their head as to how to implement that in terms of the application.ini configuration file. This is not to say that one can't figure out what's going on by doing spelunking through the ZF source code. My problem with that approach is that it's to easy to depend on something that's an implementation detail, rather than a contract, and that all it seems to do is add an extra layer of indirection that one must wade through to understand an application. I look at pre ZF 1.8 example code, before Zend_Application existed, and everywhere I see plain bootstrap files that setup the MVC framework and get on their way. The code is clear and easy to understand, even if it is a bit repetitive. I like the DRY concept that Application gets you, but particularly when I'm assuming first people looking at the app's code aren't really familiar with Zend at all, I'm considering blowing away any dependence I have on Zend_Application and returning to a traditional bootstrap file. Now, my concern here is that I don't have much experience doing this, and I don't want to get rid of Zend_Application if it does something particularly important of which I am unaware, or something of that nature. Is there a really good reason I should keep it around?

    Read the article

  • Problem with addDisplayGroup in the Zend Form

    - by ulduz114
    Hi all, I have a form same the following code: public function init(){ $id=$this->createElement('hidden','cf_id'); $id->setDecorators($this->elementDecorators); $id->setOrder(1); $this->addElement($id); $firstName=$this->createElement('text','firstName'); $firstName->setDecorators($this->elementDecorators); $firstName->setLabel('name :'); $firstName->setOrder(2); $firstName->setAttrib('class','textbox'); $firstName->setAttrib('disabled',true); $this->addElement($firstName); $lastname=$this->createElement('text','family'); $lastname->setLabel(' family:'); $lastname->setDecorators($this->elementDecorators); $lastname->setOrder(3); $lastname->setAttrib('class','textbox'); $lastname->setAttrib('disabled',true); $this->addElement($lastname); $this->addElement('button', 'cancel', array( 'label' => 'Cancel Button', 'class'=>'button', 'decorators' => array( 'ViewHelper', ), )); $this->addElement('button', 'submit', array( 'label' => 'Submit Button', 'class'=>'button', 'decorators' => array( 'ViewHelper', ), )); $this->addDisplayGroup(array('submit', 'cancel',), 'submitButtons', array( 'order'=>4, 'decorators' => array( 'FormElements', array('HtmlTag', array('tag' => 'div', 'class' => 'element')), ), )); } In this form there are some elements and two buttons. In display page, the buttons are shown above form before other elements. How can I put these buttons at the bottom of all elemnts? Thanks.

    Read the article

  • Deleting Multiple Rows with Zend DB Table Problem

    - by davykiash
    I have this data in my db Col1 Col2 DA Data1 DA Data2 DA Data3 DA Data4 DA Data5 I would like to delete all the values WHERE col1 = DA using my Zend DB Table adapter. The code below does not seem to work for multiple rows public function delete($key) { $this->delete('Col1 = "'.$key.'"'); } How can I adjust it so that I can delete multiple rows?

    Read the article

  • Zend Framework :: Ajax Requests

    - by dev-drupal
    Hi, I am looking out for any library that would facilitate Ajax in Zend (if any exist). Also can somebody throw some light on the built-in Ajax support that comes with ZF. I tried googling but was not satisfied with the results. -DevD

    Read the article

  • How to implement service layer in Zend Framework?

    - by takeshin
    I'm looking for some good resources to learn how to implement internal service layer in Zend Framework. This is interesting post, but with no concrete code samples. Where to put service classes (/application/modules/modulename/services/?); How to autoload them (custom autoloader?) Most common services (user, authentication, cart, cache, feed?) Sample implementations (any github repos?) Good practices?

    Read the article

  • Password Confirmation in zend framework

    - by Behrang
    I add this class to library/My/Validate/PasswordConfirmation.php <?php require_once 'Zend/Validate/Abstract.php'; class My_Validate_PasswordConfirmation extends Zend_Validate_Abstract { const NOT_MATCH = 'notMatch'; protected $_messageTemplates = array( self::NOT_MATCH => 'Password confirmation does not match' ); public function isValid($value, $context = null) { $value = (string) $value; $this->_setValue($value); if (is_array($context)) { if (isset($context['password']) && ($value == $context['password'])) { return true; } } elseif (is_string($context) && ($value == $context)) { return true; } $this->_error(self::NOT_MATCH); return false; } } ?> then I create two field in my form like this : $userPassword = $this->createElement('password', 'user_password'); $userPassword->setLabel('Password: '); $userPassword->setRequired('true'); $this->addElement($userPassword); //create the form elements user_password repeat $userPasswordRepeat = $this->createElement('password', 'password_confirm'); $userPasswordRepeat->setLabel('Password repeat: '); $userPasswordRepeat->setRequired('true'); $userPasswordRepeat->addPrefixPath('My_Validate','My/Validate','validate'); $userPasswordRepeat->addValidator('PasswordConfirmation'); $this->addElement($userPasswordRepeat) everything is good but when i submit form always I get the 'Password confirmation does not match' message ? What's Wrong in my code

    Read the article

  • Zend Controller Action Helper Problem not able to add helper

    - by snakeyyy
    Trying to make a controller helper to have similar functionality in some controllers using the preDispatch method. Error: Fatal error: Class 'Helper_Action_Test' not found in /var/www/zend.dev/application/Bootstrap.php on line 9` Application layout /Application /Helpers **/Actions** this is where i will save the classes /Views /modules /configs /layouts /Bootstrap.php In the Bootstrap I have added: protected function _initActionHelpers(){ Zend_Controller_Action_HelperBroker::addHelper(new Helper_Action_Test()); } In the helper file I have: class Helper_Action_Test extends Zend_Controller_Action_Helper_Abstract{ public function preDispatch() { echo 'Test'; } } Any ideas?

    Read the article

  • Howto see if form fields are identical in Zend framework

    - by atjepatatje
    Hi there, In Zend Framework (1.10) i want to check if two input fields are identical I have the following code in my form: $this->addElement('password', 'password', array( 'label' => 'Wachtwoord:', 'required' => true ) ); $this->addElement('password', 'verifypassword', array( 'label' => 'Bevestig wachtwoord:', 'required' => true, ) ); I already tryed the "identical" validator, but I did'nt got it to work.

    Read the article

  • PHP MySQL Zend-ACL - Find all inherited items (Children / Parents)

    - by Scoobler
    I have one MySQL DB table like the following, the resources table: id | name | type 1 | guest | user 2 | member | user 3 | moderator | user 4 | owner | user 5 | admin | user 6 | index | controller Onto the next table, the rules table: id | user_id | rule | resource_id | extras 1 | 2 | 3 | 1 | null 2 | 3 | 3 | 2 | null 3 | 4 | 3 | 3 | null 4 | 5 | 3 | 4 | null 5 | 6 | 1 | 1 | index,login,register 6 | 6 | 2 | 2 | login,register 7 | 6 | 1 | 2 | logout OK, sorry for the length, but I am trying to give a full picture of what I am trying to do. So the way it works, a role (aka user) can be granted (rule: 1) access to a controller, a role can inherit (rule: 3) access from another role or a role and be denied (rule: 2) access to a controller. (A user is a resource and a controller is a resource) Access to actions are granted / denied using the extras column. This all works, its not a problem with setting up the ACL within zend. What I am now trying to do is show the relationships; to do that I need to find the lowest level a role is granted access to a controller stopping if it has explicitly been removed. I plan on listing the roles. When I click a role, I want it to show all the controllers that role has access to. Then clicking on a controller shows the actions the role is allowed to do. So in the example above, a guest is allowed to view the index action of the index controller along with the login action. A member inherits the same access, but is then denied access to the login action and register action. A moderator inherits the rules of a member. So if I were to select the role moderator. I want to see the controller index listed. If I click on the controller, it should show the allowed actions as being action: index. (which was originally granted to the guest, but hasn't since been dissallowed) Is there any examples to doing this. I am obviously working with the Zend MVC (PHP) and MySQL. Even just a persudo code example would be a helpful starting point - this is one of the last parts of the jigsaw I am putting together. P.S. Obviously I have the ACL object - is it going to be easier to interigate that or is it better to do it my self via PHP/MySQL? The aim will be, show what a role can access which will then allow me to add or edit a role, controller and action in a GUI style (that is somewhat the easy bit) - currently I am updating the DB manually as I have been building the site.

    Read the article

  • Using curl_init in Zend Application is causing Session Error

    - by Gublooo
    Hey guys I'm getting this weird error in my Zend application with this piece of code: $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'www.xyz.com/ab.php'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($curl); curl_close($curl); This is the error, I get: Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'session has already been started by session.auto-start or session_start() When I remove that code everything works fine. Any idea ?? Thanks

    Read the article

  • magento on Zend Server (Win7) installation error

    - by czerasz
    I try to install magento for the first time. I've created the database with the name "project" in my C:\Zend\Apache2\conf\httpd.conf I added on the end: <Directory "C:\Zend\Apche2\htdocs\project"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> in my ZendServer/Server Setup/Extensions: PDO_MySQL, simplexml, mcrypt, hash, GD, DOM, iconv, curl, SOAP are on in C:\Zend\ZendServer\etc\php.ini I set: safe_mode = Off ;<-- was set to off ... memory_limit = 512M; Maximum amount of memory a script may consume (128MB) After step "Configuration" of magento installation (with Use Web Server (Apache) Rewrites enabled) I get: Internal Server Error My database is full of tables (that schould be ok) My Zend Server shows: 27-Oct 06:55 6 Severe Slow Request Execution (Absolute) http://localhost/project/index.php/install/wizard/installDb/ Critical Open 27-Oct 06:55 4 Fatal PHP Error C:\Zend\Apache2\htdocs\project\lib\Varien\Db\Adapter\Pdo\Mysql.php Critical Open 27-Oct 06:55 5 Slow Function Execution curl_exec Warning Open 27-Oct 06:55 5 Slow Request Execution (Absolute) http://localhost/project/index.php/install/wizard/configPost/ What can be wrong?

    Read the article

  • xDebug on Zend Server CE under Windows XP

    - by Hippyjim
    I have Zend Server installed on my Windows XP development machine, installed when I was naive and didn't know that Eclipse was going to become so suck so badly for PHP development. I've made the upgrade to Netbeans, but for debugging they only support xDebug. To be fair I've never used "proper" debuggers before, but other folks have raved about them so I thought I'd give it a try. I followed some directions on the Zend forum about how to install xDebug on Zend server, disabling Zend Debugger in the process. The xDebug "custom installation instructions" wizard tells me that my PHP was compiled with an unsupported compiler (MS VC8), and won't let me download anything. I tried a couple of the other xDebug binaries, but they just refused to load. So I'm left without a debugger option. Does anyone know how I can change the compiler of the php version I have installed so I can use a debugger in Netbeans? or how else i can get xDebug to install on Zend Server?

    Read the article

  • magento on Zend Server (Win7) installation error

    - by czerasz
    I try to install magento for the first time. I've created the database with the name "project" in my C:\Zend\Apache2\conf\httpd.conf I added on the end: <Directory "C:\Zend\Apche2\htdocs\project"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> in my ZendServer/Server Setup/Extensions: PDO_MySQL, simplexml, mcrypt, hash, GD, DOM, iconv, curl, SOAP are on in C:\Zend\ZendServer\etc\php.ini I set: safe_mode = Off ;<-- was set to off ... memory_limit = 512M; Maximum amount of memory a script may consume (128MB) After step "Configuration" of magento installation (with Use Web Server (Apache) Rewrites enabled) I get: Internal Server Error My database is full of tables (that schould be ok) My Zend Server shows: 27-Oct 06:55 6 Severe Slow Request Execution (Absolute) http://localhost/project/index.php/install/wizard/installDb/ Critical Open 27-Oct 06:55 4 Fatal PHP Error C:\Zend\Apache2\htdocs\project\lib\Varien\Db\Adapter\Pdo\Mysql.php Critical Open 27-Oct 06:55 5 Slow Function Execution curl_exec Warning Open 27-Oct 06:55 5 Slow Request Execution (Absolute) http://localhost/project/index.php/install/wizard/configPost/ What can be wrong?

    Read the article

  • xDebug on Zend Server CE under Windows XP

    - by Hippyjim
    I have Zend Server installed on my Windows XP development machine, installed when I was naive and didn't know that Eclipse was going to become so suck so badly for PHP development. I've made the upgrade to Netbeans, but for debugging they only support xDebug. To be fair I've never used "proper" debuggers before, but other folks have raved about them so I thought I'd give it a try. I followed some directions on the Zend forum about how to install xDebug on Zend server, disabling Zend Debugger in the process. The xDebug "custom installation instructions" wizard tells me that my PHP was compiled with an unsupported compiler (MS VC8), and won't let me download anything. I tried a couple of the other xDebug binaries, but they just refused to load. So I'm left without a debugger option. Does anyone know how I can change the compiler of the php version I have installed so I can use a debugger in Netbeans? or how else i can get xDebug to install on Zend Server?

    Read the article

  • How to install php cli with pnctl alongside Zend Server

    - by fazy
    I have Zend Server CE 5.6 with PHP 5.2 running on Ubuntu 11.10. Now the need has arisen to run a command line PHP script that uses PHP's pnctl functionality. First of all, I had no PHP command line in my path, so I made a symlink from the Zend one: sudo ln -s /usr/local/zend/bin/php /usr/bin However, when I run my script, I now get this error: PHP Fatal error: Call to undefined function pcntl_fork() The Zend web control panel doesn't offer pnctl in the list of modules, so how do I get this functionality? Is it safe to use apt-get to install PHP directly, to run alongside the Zend instance? If so, how do I make sure I get version 5.2? I guess the following would pull in PHP 5.3: apt-get php5-cli I could probably muddle through but any pointers to help me avoid making a mess would be much appreciated!

    Read the article

  • Drupal FAPI: Add form elements on nodeform after validation

    - by ManuelBS
    Hi, I use Drupal 6.x. In my own module I alter each node form an add my own validation handler to it using $form['#validate'][] = 'my_own_validation_function'; Then I have the function function my_own_validation_function($form, &$form_state) { //if validation fails, i would like to rebuild the form to add additional form elements in hook_form_alter $form_state['rebuild'] = True; } My problem ist, that the validation functions does not respect my 'rebuild' = True becaus the form is never processed by hook_form_alter after validation. But I need hook_form_alter to add my additional form element. Is there a solution for my problem? Or are form_state changes in an own validation handler not respected even if I set &$form_state as a "pointer"? Thanks and cheers.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >