Search Results

Search found 19716 results on 789 pages for 'zend form'.

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

  • Selecting arbitrary strings with Zend DB Select?

    - by wizzard
    I am using the fluent interface to create a Zend DB Select object/query. As part of the query, I would like to select an arbitrary string, like "SELECT 'foo' AS 'type' FROM ...". foo is not a column, it's just a string literal. When I select an arbitrary number, the query works as expected. When I change it to a string, Zend tries to treat foo as a column, and throws an error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'l.foo' in 'field list' I have tried wrapping the string in Zend_Db_Expr in various ways such as: $select->columns(array('type' => new Zend_Db_Expr('foo'))); That stops Zend from adding the correlation name, but it still treats it as a column: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'foo' in 'field list' I feel like I must be missing something obvious here. How do I tell Zend to stop treating this as a column?

    Read the article

  • How to avoid index.php in Zend Framework?

    - by henriquev
    I'm using the Zend Router and so things like (/ and /index.php) or (/about and /index.php/about) ends up as the same here. However, /index.php/whatever should not exist as it is the exactly same resource as /whatever so it doesn't make a sense the duplication. How do I avoid this? Even http://zendframework.com/manual/en/zend.controller.router.html and http://zendframework.com/index.php/manual/en/zend.controller.router.html both exists. It doesn't make any sense at all...

    Read the article

  • Difference between Zend Framework 1.8 and 1.11 [closed]

    - by user985482
    Hi I have about 6 months of PHP experience and now I am thinking of starting of learning Zend Framework. I learn best usually from books and I noticed on amazon that the most recent release is for the version 1.8. Zend Framework 1.8 Web Application Development Since the curent version is 1.11 will this be a problem in the future? What is the difference beetween the versions. Can anyone recommend a more recent book for this framework?

    Read the article

  • Zend Form not in place labbels values, how to move them that they will be exactly above text box?

    - by Yosef
    Hi, I have esthetic's problem. Zend Form not in place label value, how to move them that they will be exactly above text box, and not from left? (I didn't put filters and validation to make this code simpler here) Thanks, Yosef My Code Login.php form: public function init() { $username = new Zend_Form_Element_Text('username'); $username->setLabel("username"); $password = new Zend_Form_Element_Password('password'); $password->setLabel('password'); $this->addElements(array($username, $password)); }

    Read the article

  • How do I add complex where clause to Zend Table Select?

    - by AD
    I searched the Web and could not find anything that would show me a good solid example. My question is basically this: How do I convert this: SELECT * FROM table WHERE ((a = 1 AND b = 2) OR (c = 3 OR c = 4)) AND d = 5; To Zend syntax similar to this: $this -select() -from($this-_schema.'.'.$this-_name) -where('a = ?', '1'); So how can it be done? Thank a lot in advance.

    Read the article

  • Zend Framework: isValid() clears values from disabled form fields!

    - by Andrew
    When you submit a form, disabled form fields are not submitted in the request. So if your form has a disabled form field, it makes working with Zend_Form::isValid() a little frustrating. $form->populate($originalData); $form->my_text_field->disabled = 'disabled'; if (!$form->isValid($_POST)) { //form is not valid //since my_text_field is disabled, it doesn't get submitted in the request //isValid() will clear the disabled field value, so now we have to re-populate the field $form->my_text_field->value($originalData['my_text_field']); $this->view->form = $form; return; } // if the form is valid, and we call $form->getValues() to save the data, our disabled field value has been cleared! Without having to re-populate the form, and create duplicate lines of code, what is the best way to approach this problem?

    Read the article

  • How do I write a custom validator for a zend form element with customized error messages?

    - by Mallika Iyer
    I have a question field with a list of allowed characters : A-Z,0-9,colon (:), question mark (?), comma(,), hyphen(-), apostrophe ('). I have the regex which works fine, in the fashion : $question->addValidator('regex', true, array(<regular expresstion>)) The default error message is something like ''' does not match against pattern '' I want to write a custom error message that says ' is not allowed in this field' Is there a simple way to do it using the existing zend components that I'm missing? Is writing a custom validator the only way to achieve what I'm trying to achieve? If yes, how do I write a custom validator (I looked at the documentation and didn't quite understand how I can customize the error messages) If there is any other way, I'd most appreciate that input too. Thanks for taking the time to answer this!

    Read the article

  • How to get Ruby support in Zend Studio?

    - by Andrew
    Zend Studio is basically Eclipse that has been optimized for working with Zend Framework projects. Well I have a few files in my Zend Framework project that happen to be Ruby files. Zend Studio doesn't come with the ability to create/edit Ruby files with syntax highlighting. I could open in the default text editor, but there won't be any syntax highlighting. How can I add support for Ruby files in Zend Studio?

    Read the article

  • Zend currency custom format like "$ 1,234.56 USD"

    - by Jorre
    I'm using the zend currency module to manage currencies in a web app. I can't figure out how to create a custom format for my currencies, since there are no examples on the documentation pages: http://framework.zend.com/manual/en/zend.currency.options.html From what I read there, I could use the format parameter to set a format, but I can't find a way how. Does anyone have a good code example for this problem? currently I do the following: $currency->setFormat(array (display' => Zend_Currency::USE_SYMBOL)); That works to display only the symbol, but I'm also interested in putting an extra space after or before the symbol and to display currencies like this: "$ 1,234.56 USD" "€ 1.234,56 EUR"

    Read the article

  • Zend_Date and Zend Locale; can't get it to work ><

    - by Rick de Graaf
    Loving Zend Framework, hating Zend_Date... I'm buidling an app where one of the functions is to track the time one spends on a certain task. This works great. My previous question was my incapability to get the sum of all the timestamps (time spent on each task). Well that works as a charm, but when I echo this value, it adds one hour. Using gmdate() (just for checking) and the value turns out exactly as it's supposed to. I thought to solve this problem easeliy with Zend_Local, but I can't get the damn thing to work! This is my bootstrap code: protected function _initLocale() { $locale = new Zend_Locale('nl_NL'); $locale->setLocale($locale); Zend_Registry::set('Zend_Locale', $locale); } This is the code in my view file: $date = new Zend_Date($this->timequery, null, $locale); echo $date->toString(Zend_Date::HOUR.':'.Zend_Date::MINUTE.':'.Zend_Date::SECOND); The timestamp I'm processing is: 2632 which equals 00:43:52. The output I get is: 01:43:52 I know the extra hour comes from the time difference, but I can seem to solve this with Zend_Local and Zend_Date.

    Read the article

  • Multiple table relationships in Zend Help

    - by Zogi
    Hi Guys I have been doing some DB mapping to link two tables to no avail. Everytime I run the code I get the following error: Message: File "Role.php" does not exist or class "Role" was not found in the file Stack trace: #0 C:\wamp\www\zend\library\Zend\Db\Table\Row\Abstract.php(867): Zend_Db_Table_Row_Abstract->_getTableFromString('Role') #1 C:\wamp\www\uw\application\models\admin\User.php(56): Zend_Db_Table_Row_Abstract->findDependentRowset('Role') #2 C:\wamp\www\uw\application\controllers\AdminController.php(110): Application_Model_Admin_User->getUsers() #3 C:\wamp\www\zend\library\Zend\Controller\Action.php(513): AdminController->usersAction() #4 C:\wamp\www\zend\library\Zend\Controller\Dispatcher\Standard.php(289): Zend_Controller_Action->dispatch('usersAction') #5 C:\wamp\www\zend\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #6 C:\wamp\www\zend\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch() #7 C:\wamp\www\zend\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run() #8 C:\wamp\www\uwi\public\index.php(26): Zend_Application->run() #9 {main} Code & DB below: application/models/admin/User.php class Application_Model_Admin_User extends Zend_Db_Table_Abstract { protected $_name = 'user'; protected $_dependentTables = array('Role'); public function getUsers() { $rows = $this->fetchAll($this->select()->where('active = ?', 1)); $rows1 = $rows->current(); $rows2 = $rows1->findDependentRowset('Role'); return $rows2; } } application/models/admin/Role.php class Application_Model_Admin_Role extends Zend_Db_Table_Abstract { protected $_name = 'role'; protected $_referenceMap = array ( 'Role' => array( 'columns' => array('id'), 'refTableClass' => 'User', 'refColumns' => array('role_id') ); } DB tables CREATE TABLE role ( id integer auto_increment NOT NULL, name varchar(120), PRIMARY KEY(id) ); CREATE TABLE user ( id integer auto_increment NOT NULL, username varchar(120), PRIMARY KEY(id), FOREIGN KEY(role_id) REFERENCES role(id) );

    Read the article

  • ZF: Form array field - how to display values in the view correctly

    - by Wojciech Fracz
    Let's say I have a Zend_Form form that has a few text fields, e.g: $form = new Zend_Form(); $form->addElement('text', 'name', array( 'required' => true, 'isArray' => true, 'filters' => array( /* ... */ ), 'validators' => array( /* ... */ ), )); $form->addElement('text', 'surname', array( 'required' => true, 'isArray' => true, 'filters' => array( /* ... */ ), 'validators' => array( /* ... */ ), )); After rendering it I have following HTML markup (simplified): <div id="people"> <div class="person"> <input type="text" name="name[]" /> <input type="text" name="surname[]" /> </div> </div> Now I want to have the ability to add as many people as I want. I create a "+" button that in Javascript appends next div.person to the container. Before I submit the form, I have for example 5 names and 5 surnames, posted to the server as arrays. Everything is fine unless somebody puts the value in the field that does not validate. Then the whole form validation fails and when I want to display the form again (with errors) I see the PHP Warning: htmlspecialchars() expects parameter 1 to be string, array given Which is more or less described in ticket: http://framework.zend.com/issues/browse/ZF-8112 However, I came up with a not-very-elegant solution. What I wanted to achieve: have all fields and values rendered again in the view have error messages only next to the fields that contained bad values Here is my solution (view script): <div id="people"> <?php $names = $form->name->getValue(); // will have an array here if the form were submitted $surnames= $form->surname->getValue(); // only if the form were submitted we need to validate fields' values // and display errors next to them; otherwise when user enter the page // and render the form for the first time - he would see Required validator // errors $needsValidation = is_array($names) || is_array($surnames); // print empty fields when the form is displayed the first time if(!is_array($names))$names= array(''); if(!is_array($surnames))$surnames= array(''); // display all fields! foreach($names as $index => $name): $surname = $surnames[$index]; // validate value if needed if($needsValidation){ $form->name->isValid($name); $form->surname->isValid($surname); } ?> <div class="person"> <?=$form->name->setValue($name); // display field with error if did not pass the validation ?> <?=$form->surname->setValue($surname);?> </div> <?php endforeach; ?> </div> The code work, but I want to know if there is an appropriate, more comfortable way to do this? I often hit this problem when there is a need for a more dynamic - multivalue forms and have not find better solution for a long time.

    Read the article

  • Zend Server experiences

    - by Luke
    The other day I was looking into Zend Server and I was wondering why I would use this? OK, they say it's all tested and mission critical and Enterprise ready etc. But to me that's just the marketing department talking. Is anyone out there using this product and if so can you share your experiences with it and maybe you could also elaborate on the reason on why you choose this product for your application(s). Did you find any real benefits to using Zend server?

    Read the article

  • Creating a Model using Stored Procedures with Zend Framework

    - by jwhat
    I'm using Zend Framework and I'd like to build a model to perform read/write operations on a database... using stored procedures. I know how stored procedures work, but I have yet to use them within Zend Framework. Is there any built in support for stored procedures that I should know about? What is the best practice way to create a model in this senario? Should I extend Zend_Db_Table_Abstract or some other class?

    Read the article

  • Zend_Form using subforms getValues() problem

    - by wiseguydigital
    Hi all, I am building a form in Zend Framework 1.9 using subforms as well as Zend_JQuery being enabled on those forms. The form itself is fine and all the error checking etc is working as normal. But the issue I am having is that when I'm trying to retrieve the values in my controller, I'm receiving just the form entry for the last subform e.g. My master form class (abbreviated for speed): Master_Form extends Zend_Form { public function init() { ZendX_JQuery::enableForm($this); $this->setAction('actioninhere') ... ->setAttrib('id', 'mainForm') $sub_one = new Form_One(); $sub_one->setDecorators(... in here I add the jQuery as per the docs); $this->addSubForm($sub_one, 'form-one'); $sub_two = new Form_Two(); $sub_two->setDecorators(... in here I add the jQuery as per the docs); $this->addSubForm($sub_two, 'form-two'); } } So that all works as it should in the display and when I submit without filling in the required values, the correct errors are returned. However, in my controller I have this: class My_Controller extends Zend_Controller_Action { public function createAction() { $request = $this->getRequest(); $form = new Master_Form(); if ($request->isPost()) { if ($form->isValid($request->getPost()) { // This is where I am having the problems print_r($form->getValues()); } } } } When I submit this and it gets past isValid(), the $form-getValues() is only returning the elements from the second subform, not the entire form.

    Read the article

  • Zend Framework Form Element Validators - validate a field even if not required

    - by Jeremy Hicks
    Is there a way to get a validator to fire even if the form element isn't required? I have a form where I want to validate the contents of a texbox (make sure not empty) if the value of another form element, which is a couple of radio buttons, has a specific value selected. Right now I'm doing this by overriding the isValid() function of my form class and it works great. However, I'd like to move this to either its on validator or use the Callback validator. Here's what I have so far, but it never seems to get called unless I change the field to setRequired(true) which I don't want to do at all times, only if the value of the other form element is set to a specific value. // In my form class's init function $budget = new Zend_Form_Element_Radio('budget'); $budget->setLabel('Budget') ->setRequired(true) ->setMultiOptions($options); $budgetAmount = new Zend_Form_Element_Text('budget_amount'); $budgetAmount->setLabel('Budget Amount') ->setRequired(false) ->addFilter('StringTrim') ->addValidator(new App_Validate_BudgetAmount()); //Here is my custom validator (incomplete) but just testing to see if it even gets called. class App_Validate_BudgetAmount extends Zend_Validate_Abstract { const STRING_EMPTY = 'stringEmpty'; protected $_messageTemplates = array( self::STRING_EMPTY => 'please provide a budget amount' ); public function isValid($value) { echo 'validating...'; var_dump($value); return true; } }

    Read the article

  • Zend license restrictions with modified code

    - by Maximilian_v3
    If I'm to take parts of Zend Framework and changed them (add something, remove...), and then changed it's name, for example Zend_Config to My_Config or Zend_Application_Bootstrap to My_Application_Bootstrap, and then distribute such a code with a commercial license would I then be violating Zend's licence? If that is not an option, what can I do then? Do I need to use their code "as is" without changes if I want do distribute it with my commercial application? Tnx :)

    Read the article

  • Zend_Auth / Zend_Session error and storing objects in Auth Storage

    - by Martin
    Hi All, I have been having a bit of a problem with Zend_Auth and keep getting an error within my Acl. Within my Login Controller I setup my Zend_Auth storage as follows $auth = Zend_Auth::getInstance(); $result = $auth->authenticate($adapter); if ($result->isValid()) { $userId = $adapter->getResultRowObject(array('user_id'), null)->user_id; $user = new User_Model_User; $users = new User_Model_UserMapper; $users->find($userId, $user); $auth->getStorage()->write( $user ); } This seems to work well and I am able to use the object stored in the Zend_Auth storage within View Helpers without any problems. The problem that I seem to be having is when I try to use this within my Acl, below is a snippet from my Acl, as soon as it gets to the if($auth->hasIdentity()) { line I get the exception detailed further down. The $user->getUserLevel() is a methord within the User Model that allows me to convert the user_level_id that is stored in the database to a meaning full name. I am assuming that the auto loader sees these kind of methords and tries to load all the classes that would be required. When looking at the exception it appears to be struggling to find the class as it is stored in a module, I have the Auto Loader Name Space setup in my application.ini. Could anyone help with resolving this? class App_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract { protected $_roleName; public function __construct() { $auth = Zend_Auth::getInstance(); if($auth->hasIdentity()) { $user = $auth->getIdentity(); $this->_roleName = strtolower($user->getUserLevel()); } else { $this->_roleName = 'guest'; } } } Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'Zend_Session::start() - \Web\library\Zend\Loader.php(Line:146): Error #2 include_once() [&lt;a href='function.include'&gt;function.include&lt;/a&gt;]: Failed opening 'Menu\Model\UserLevel.php' for inclusion (include_path='\Web\application/../library;\Web\library;.;C:\php5\pear') Array' in \Web\library\Zend\Session.php:493 Stack trace: #0 \Web\library\Zend\Session\Namespace.php(143): Zend_Session::start(true) #1 \Web\library\Zend\Auth\Storage\Session.php(87): Zend_Session_Namespace-&gt;__construct('Zend_Auth') #2 \Web\library\Zend\Auth.php(91): Zend_Auth_Storage_Session-&gt;__construct() #3 \Web\library\Zend\A in \Web\library\Zend\Session.php on line 493 Thanks, Martin

    Read the article

  • [Zend Debugger] Cannot receive start command

    - by tharkun
    Hi I have a WAMP install (Apache 2.2.3, PHP 5.2.8) with a working Zend Optimizer. As soon as I add the php.ini lines for Zend Debugger: [Zend Debugger] zend_extension_manager.debug_server_ts="C:\zenddebugger" zend_debugger.allow_hosts=127.0.0.1/32, 192.168.0.0/16, 192.168.1.0/255 zend_debugger.expose_remotely=always and restart apache, I get a blank page and the following entry in the apache error log. [Zend Debugger] Cannot receive start command [Zend Debugger] Cannot send message Now the incredible thing is that I had it working this morning and now, after reinstalling WAMP there is no way I can get it work again. php.ini is exactly the same as it was before. I would be extremely glad to get help, I'm trying to get a working server environment going for over a month, can you believe that? I tried XAMPP, Zend Server and now WAMP and I'm going crazy slowly but surely.

    Read the article

  • apache server not working after installing zend server

    - by kamal
    i have apache installed in my redhat 5.3 server machine. and i was trying to install zend server. i installed zend server with install.sh file in directory /var/zend. in my windows machine after installling zend server community edition i was able to access apache server as well as zend server. but in my linux machine localhost displays nothing and localhost:10081 shows zend server. what can i do to run my localhost? or should i seperately install apache?

    Read the article

  • Zend hostname route doesn't match when it has child routes

    - by talisker
    I am implementing an Admin module, which contains the following routes: 'router' => array( 'routes' => array( 'admin' => array( 'type' => 'Zend\Mvc\Router\Http\Hostname', 'options' => array( 'route' => ':subdomain.mydomain.local', 'constraints' => array( 'subdomain' => 'admin', ), 'defaults' => array( 'module' => '__NAMESPACE__', 'controller' => 'Admin\Controller\Index', 'action' => 'index', ), ), 'priority' => 9000, 'may_terminate' => true, 'child_routes' => array( 'users' => array( 'type' => 'Zend\Mvc\Router\Http\Literal', 'options' => array( 'route' => '/users', 'defaults' => array( 'module' => '__NAMESPACE__', 'controller' => 'Admin\Controller\Users', 'action' => 'index', ), ), ), ) ), ), ), And this is the home route configuration: 'home' => array( 'type' => 'Zend\Mvc\Router\Http\Literal', 'options' => array( 'route' => '/', 'defaults' => array( 'controller' => 'Application\Controller\Index', 'action' => 'index', ), ), ), When I try to access to http://admin.mydomain.com, the route match always with the homeroute, but if I remove all the child routes from the admin route, the behavior is correct and a http://admin.mydomain.com matches with the adminroute. Any idea?

    Read the article

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