Search Results

Search found 11280 results on 452 pages for 'zend newbie dev'.

Page 37/452 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • Creating Zend_Form elements from row html

    - by P.M
    Hi there, I am having an issue with Zend_Form and your help will be appreciated. in fact I have a class to generate categories as options $categories = My_Util_Category::toHtmlSelect();//for simplicity I removed other lines this code generates <select> <option > root</option> <option> root / children</option> </select> On another hand, I use Zend_Form form to edit categories. The code looks like: $form = My_Form_Category( $data, $selectElements = array() ); which outputs a form, text field, a select box for parent categories and a submit button. How can I get 'select element' from $form, and replace it with row html 'select' generated with $categories any help, or link will be appreciated. Thanks.

    Read the article

  • Adding a class to the $tag surrounding a <label> in a Zend_Form with the Label decorator

    - by Roderik
    I'm trying to get the following html out of Zend_Form <div class="group wat-cf"> <div class="left"> <label class="label right">Username</label> </div> <div class="right"> <input type="text" class="text_field"> </div> </div> Using the following code: $username->setAttrib("class", "text_field") ->setDecorators(array( 'ViewHelper', 'Description', 'Errors', array(array('data'=>'HtmlTag'), array('tag' => 'div', 'class' => 'right')), array('Label', array('tag' => 'div', 'class' => 'label right')), array(array('row'=>'HtmlTag'),array('tag'=>'div', 'class' => 'group wat-cf')) )); I can get the next fragment <div class="group wat-cf"> <div id="username-label"> <label for="username" class="label right required">Username:</label> </div> <div class="right"> <input type="text" name="username" id="username" value="" class="text_field"> </div> </div> so apart from some extra id's and required classes i don't mind, i need to get a class "left" on div id="username-label" Now adding class to the Label line, gets the class added on the element. I also don't see and option to do this in the Label decorator code itself. So i need a custom Label decorator, or is there some other way i'm missing?

    Read the article

  • Zend_Form -> Nicely change setRequired() validate message

    - by dittonamed
    Say I create a text element like this: $firstName = new Zend_Form_Element_Text('firstName'); $firstName->setRequired(true); Whats the best way to change the default error message from: Value is empty, but a non-empty value is required to a custom message? I read somewhere that to replace the message, just use addValidator(..., instead (NO setRequired), like this: $firstName = new Zend_Form_Element_Text('firstName'); $firstName->addValidator('NotEmpty', false, array('messages'=>'Cannot be empty')); but in my testing, this doesn't work - it doesn't validate at all - it will pass with an empty text field. Using both (addValidator('NotEmp.. + setRequired(true)) at the same time doesn't work either - it double validates, giving two error messages. Any ideas? Thanks!

    Read the article

  • Zend_Paginator - Increase querys

    - by poru
    Hello, I started using Zend_Paginator, it works everything fine but I noticed that there is one more query which slows the load time down. The additional query: SELECT COUNT(1) AS `zend_paginator_row_count` FROM `content` The normal query: SELECT `content`.`id`, `content`.`name` FROM `content` LIMIT 2 PHP: $adapter = new Zend_Paginator_Adapter_DbSelect($table->select()->from($table, array('id', 'name'))); $paginator = new Zend_Paginator($adapter); Could I merge the two querys into one (for better performance)?

    Read the article

  • Set Action Controller name for Zend_Tool create controller

    - by Cobby
    Hi All, All my controllers use a custom Action Controller class, is there anyway to set the action controller class it uses when generating the the controller code? Or would be even better if I could set it up to map the action controller class to use based on the module the class is being created under. Cheers.

    Read the article

  • Problem with Zend_Date and ISO_8601 format

    - by Noah Goodrich
    Frankly, I'm flummoxed. Can anyone tell me why I would get a failure message with this code? $date = Zend_Date::now(); $date = $date->getIso(); if(Zend_Date::isDate($date, Zend_Date::ISO_8601)) { print('success'); } else { print('failure'); } exit; It also fails if I just pass in a Zend_Date object. UPDATE: a var_dump of the initial $date object looks like this: object(Zend_Date)#107 (8) { ["_locale:private"]= string(5) "en_US" ["_fractional:private"]= int(0) ["_precision:private"]= int(3) ["_unixTimestamp:private"]= int(1257508100) ["_timezone:private"]= string(14) "America/Denver" ["_offset:private"]= int(25200) ["_syncronised:private"]= int(0) ["_dst:protected"]= bool(true) } And a var_dump of the $date string after calling $date-getIso() looks like this: string(25) "2009-11-06T04:48:20-07:00" I am using ZF 1.9.5 on PHP 5.2.8. I am using XAMPP for Windows too if that makes a difference.

    Read the article

  • Adding Parameters to Zend_Navigation

    - by Grant Collins
    I have a problem with Zend_Navigation that I am hoping for a little guidance on. I'm in the process of adding a Zend_Navigation to a legacy app as described [here on SO].1 The thing that I am not sure of is how to add parameters to the navigation menu after the data is loaded from the xml file. What I want to do is get 2 identifying parameters from the url and add them to the Zend_Navigation so that they are included in things such as the breadcrumb bar, so that if a user selects the previous item in the breadcrumb they are returned with the correct params in the url. The parameters, I believe need to be set at the Action level rather than the controller. Any help would be appreciated. Many thanks.

    Read the article

  • How to setup a Zend_Application with an application.ini and a user.ini

    - by Peter Smit
    I am using Zend_Application and it does not feel right that I am mixing in my application.ini both application and user configuration. What I mean with this is the following. For example, my application needs some library classes in the namespace MyApp_ . So in application.ini I put autoloaderNamespaces[] = "MyApp_". This is pure application configuration, no-one except a programmer would change these. On the other hand I put there a database configuration, something that a SysAdmin would change. My idea is that I would split options between an application.ini and an user.ini, where the options in user.ini take preference (so I can define standard values in application.ini). Is this a good idea? How can I best implement this? The idea's I have are Extending Zend_Application to take multiple config files Making an init function in my Bootstrap loading the user.ini Parsing the config files in my index.php and pass these to Zend_Application (sounds ugly) What shall I do? I would like to have the 'cleanest' solution, which is prepared for the future (newer ZF versions, and other developers working on the same app)

    Read the article

  • How can I simply change the Timezone Offset with Zend_Date?

    - by Nicky Hajal
    I'm using Zend_Date to manage dates/times in a scheduling app. The only way I'm able to determine the user's Timezone is via Javascript which only gives a Timezone Offset. Zend_Date only seems to take Timezones in the 'America/New_York' format. Is there a way to get the users timezone in this format or set the Timezone Offset with Zend_Date? Thanks!

    Read the article

  • Zend_Search_Lucene and range search

    - by ranza
    I have a bunch of int key fields in my index and trying to do a simple range search like this: `gender:1 AND height:[120 TO 180]` This should give me male in the height range 120 to 180. But for some reason i get this exception: `At least one range query boundary term must be non-empty term` How would i debug this? Is it just Zend_Search_Lucene being buggy?

    Read the article

  • How can I set the class for a <dt> element in a Zend_Form?

    - by Mallika Iyer
    I'm trying to set the width of the style for a group of < dt elements in a Zend_Form. Is there a way to set a class for a dt element, so the end result would be something like this: <dt id="name-label" class="xyz" > // trying to add the 'class="xyz" <label class="required" for="name">Name:</label> </dt> <dd id="name-element"> <input type="text" maxlength="255" size="30" value="" id="name" name="name"> </dd>

    Read the article

  • /regexp?/ on HTML, but not in form

    - by takeshin
    I need to do some regex replacement on HTML input, but I need to exclude some parts from filtering by other regexp. (e.g. remove all <a> tags with specific href="example.com…, except the ones that are inside the <form> tag) Is there any smart regex technique for this? Or do I have to find all forms using $regex1, then split the input to the smaller chunks, excluding the matched text blocks, and then run the $regex2 on all the chunks?

    Read the article

  • Zend_ACL isAllowed causes issues with dojo

    - by churris43
    Hi all, I got an issue setting up Zend_Acl, I got it pretty well setup and running but I realised that in some forms where I'm using zend_dojo, dojo doesn't actualy gets loaded. Without going to I have setup my access list, as soon as I call the line isAllowed with the name of the resource taken from the request object, dojo is not loaded (I think) This is the code that breaks dojo: class MyPluginAcl extends Zend_Controller_Plugin_Abstract { public function __construct(Zend_Acl $acl) { $this->_acl = $acl; } public function preDispatch(Zend_Controller_Request_Abstract $request) { ..... $role = "guest" $resource = $request->getControllerName(); var_dump($resource) //Returns string(10)'myresource' $action = $request->getActionName(); if (!$this->_acl->isAllowed($role, $resource,$action)){ //Code to redirect somewhere } ...... } The thing that doesn't make sense are the following: If I do a var_dump($resource) I get a string(10)'myresource', still doesn't work If I set the $resource to be $resource = new Zend_Acl_Resource($request->getControllerName()); still doesn't work , but If I set $resource to have a string value, this whole thing works (eg. $resources = "myresource; it works. Any ideas ... Thanks

    Read the article

  • Zend_Form MultiCheckbox not checking boxes

    - by azz0r
    $groups = Model_UserGroup::load_links($object->id); foreach ($groups as $item) { $object->group[$item->group_id] = $item->enabled; } $array_object = (array) $object;//turn the object to an array so zend_form can use it $form->populate($array_object); enabled = 1 or 0 In the form class: $group = new Zend_Form_Element_MultiCheckbox('group'); $groups = Model_Group::load_all(); $new_item = array(); foreach ($groups as $item) { $group->addMultiOption($item->id, $item->name); } However the top group is the only one ever checked. Anyone spot anything glaringly wrong? I know its difficult to get a grasp of my layout/setup for this. Here is the array_object: Array ( [table_name] => User [id] => 112 [updated] => 1269428783 [created] => 1153237813 [group] => Array ( [1] => 1 [3] => 1 ) ) Here is the html zend_form is creating: <dd id="group-element"> <label for="group-1"><input name="group[]" id="group-1" value="1" checked="checked" type="checkbox">Administrator Access</label><br> <label for="group-2"><input name="group[]" id="group-2" value="2" type="checkbox">Content Admin</label><br> <label for="group-3"><input name="group[]" id="group-3" value="3" type="checkbox">Administrator</label><br> <label for="group-4"><input name="group[]" id="group-4" value="4" type="checkbox">Studio</label> </dd> edit: just done a small test and made the $groups (in the first set of code tags) empty and it still ticks the first box. hm Fixed this by doing: // $selected_groups = Model_UserGroup::load_links($object->id); $group_ticks = array(); foreach ($selected_groups as $item) { if ($item->enabled == 1) { $group_ticks[] = $item->group_id;//$form->group->setValue($item->group_id); } } $form->group->setValue($group_ticks); //

    Read the article

  • Zend_Form validation problem

    - by GrumpyCanuck
    I am having problems getting validation to work for a form built using Zend_Form. The idea is this: I have two dropdown. One is a list of players. The other is a list of free agents who play the same position as the player. I am using an onChange javascript callback to run some Ajax code that replaces the free agent list dropdown with a new one at the position of the player they've selected from the player dropdown. Now, perhaps this is the wrong way, but I built the form by creating an instance of Zend_Form and then creating all these setX methods that add elements to the form. My reasoning was that I wanted to display certain elements in specific places on the page, not just output $this-form on my template. The problem appears to be when I get the form post back, the validator seems to not know about the validation rule I set up for the free agent drop down. Here's some relevant code to look at. I'm a relative ZF n00b so feel free to tell me I am not doing things the ZF way if it leaps out at you. The action in the controller: public function indexAction() { if ($this->getRequest()->isPost()) { $form = new Baseball_Form_Transactions(); if ($form->isValid($this->_request->getPost())) { $data = $this->_request->getPost(); $leagueInfo = Doctrine::getTable('League')->findOneByShortName($data['shortLeagueName'])->toArray(); // Create the request top drop an existing player $transactionInfo = array( 'league_id' => $leagueInfo['id'], 'team_id' => $data['teamId'], 'player_id' => $data['players'], 'type' => 'drop', 'target_team_id' => 0, 'transaction_date' => date('Y-m-d H:m:s') ); $transaction = new Transaction(); $transaction->fromArray($transactionInfo); $transaction->save(); // Now we do the request to add a player $transactionInfo['team_id'] = 0; $transactionInfo['player_id'] = $data['freeAgents']; $transactionInfo['target_team_id'] = $data['teamId']; $transactionInfo['type'] = 'add'; $transaction = new Transaction(); $transaction->fromArray($transactionInfo); $transaction->save(); $this->_flashMessenger->addMessage('Added transaction'); } } $options = array( 'teamId' => $this->teamId, 'position' => 'C', 'leagueShortName' => $this->league ); $this->transactionForm->setMyPlayers($options); $this->transactionForm->setFreeAgents($options); $this->transactionForm->setTeamId($options); $this->transactionForm->setShortLeagueName($options); $this->view->transactionForm = $this->transactionForm; $this->view->messages = $this->_flashMessenger->getMessages(); $transaction = new Transaction(); $this->view->transactions = $transaction->byTeam($options); } Next we have the form itself public function setMyPlayers($options) { $data = Doctrine::getTable('Team')->find($options['teamId']); $players = array(); foreach ($data->Players->toArray() as $player) { $players[$player['id']] = "{$player['position']} - {$player['first_name']} {$player['last_name']}"; } $playersSelect = new Zend_Form_Element_Select( 'players', array( 'required' => true, 'label' => 'Players', 'multiOptions' => $players, ) ); $this->addElement($playersSelect); } public function setFreeAgents($options) { $q = Doctrine_Query::create() ->select('CONCAT(p.first_name, " ", p.last_name) as full_name, p.id, p.position') ->from('Player p') ->leftJoin('p.Teams t') ->leftJoin('t.League l ON l.short_name = ?', $options['leagueShortName']) ->where('t.id IS NULL') ->andWhere('p.position = ?', $options['position']) ->orderBy('p.last_name'); $q->setHydrationMode(Doctrine_Core::HYDRATE_ARRAY); $data = $q->execute(); $freeAgents = array(); foreach ($data as $player) { $freeAgents[$player['id']] = $player['full_name']; } $freeAgentsSelect = new Zend_Form_Element_Select( 'freeAgents', array( 'label' => 'Free Agents', 'multiOptions' => $freeAgents, 'size' => 15 ) ); $freeAgentsSelect->setRequired(true); $this->addElement($freeAgentsSelect); } public function setShortLeagueName($options) { $shortLeagueNameHidden = new Zend_Form_Element_Hidden( 'shortLeagueName', array('value' => $options['leagueShortName']) ); $this->addElement($shortLeagueNameHidden); } public function setTeamId($options) { $teamIdHidden = new Zend_Form_Element_Hidden( 'teamId', array('value' => $options['teamId']) ); $this->addElement($teamIdHidden); } There is no init or __construct() method in the form. My problem seems simple enough: reject the form contents as invalid if they have not selected someone from the free agent list. Right now, it sails through as valid. I've spent some considerable time searching online for an answer, and haven't been able to find it. Thanks in advance for any help.

    Read the article

  • Zend_Search_Lucene range query error

    - by Maurice
    I have set up each document with a date field. (keyword) Values stored in it are in this format; 20100511 Each time I try to perform a ranged query, I get the following error: date:[10000000 TO 20000000] At least one range query boundary term must be non-empty term Anyone got a clue?

    Read the article

  • Zend_Db_Select: regrouping conditions in where clause

    - by pvledoux
    Hi, I would like to do something like this: $select = $myTbl->select() ->from('download_log') ->joinLeft(...... etc........ ->joinLeft(...... etc........ ->joinLeft(...... etc........); //Filter all configured bots (Google, Yahoo, etc.) if(isset($this->_config->statistics->bots)){ $bots = explode(',',$this->_config->statistics->bots); foreach ($bots as $bot){ $select = $select->orWhere("user_agent NOT LIKE '%$bot%'"); } } $select = $select->where("download_log.download_log_ts BETWEEN '".$start_date." 00:00:00' AND '".$end_date." 23:59:59'"); But the outputed query is not correct because of the orWhere clauses are not grouped together in a unique AND clause. I would like to know if it is possible to regrouped those OR clauses in a pair of parentheres. My current alternative is the following: //Filter all configured bots (Google, Yahoo, etc.) if(isset($this->_config->statistics->bots)){ $bots = explode(',',$this->_config->statistics->bots); foreach ($bots as $bot){ $stmt .= "user_agent NOT LIKE '%$bot%' OR "; } $stmt = substr($stmt,0,strlen($stmt)-3); //remove the last OR $select = $select->where("($stmt)"); } Thanks!

    Read the article

  • Zend_Db_Table - Update don't work

    - by poru
    The code seems not working. // $counter is an instance of Zend_Db_Table_Abstract $counter->update(array('hits' => 'hits+1'), '"id" = 1'); I took a look into the DB profiler and find the following query: UPDATE `downloads` SET `hits` = ? WHERE ("id" = 1)

    Read the article

  • Where should libraries be placed, in windows?

    - by Gabriel Diaconescu
    I have just moved from Linux to Windows, and I have to use the Zend Framework library. Where should the library be placed? Directly on C drive Create a lib folder like C:/lib/ Create a lib folder in my user folder I am wondering if there is a classic folder where these kind of libraries are placed. Update:I am asking about the location on my own standpoint. The Zend Framework library is a PHP framework.

    Read the article

  • Google Spreadsheet API problem: memory exceeded

    - by Robbert
    Hi guys, Don't know if anyone has experience with the Google Spreadsheets API or the Zend_GData classes but it's worth a go: When I try to insert a value in a 750 row spreadsheet, it takes ages and then throws an error that my memory limit (which is 128 MB!) was exceeded. I also got this when querying all records of this spreadsheet but this I can imaging because it's quite a lot of data. But why does this happen when inserting a row? That's not too complex, is it? Here's the code I used: public function insertIntoSpreadsheet($username, $password, $spreadSheetId, $data = array()) { $service = Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME; $client = Zend_Gdata_ClientLogin::getHttpClient($username, $password, $service); $client->setConfig(array( 'timeout' => 240 )); $service = new Zend_Gdata_Spreadsheets($client); if (count($data) == 0) { die("No valid data"); } try { $newEntry = $service->insertRow($data, $spreadSheetId); return true; } catch (Exception $e) { return false; } }

    Read the article

  • Zend_Controller_Router_Route: Could not find a translator

    - by Antonio
    I am developing a multilanguage application. In the bootstrap there is the routes setup: protected function _initRoutes() { $this->bootstrap('frontController'); $router = $this->frontController->getRouter(); // PAGES ROUTE $page = new Zend_Controller_Router_Route( ':language/:ident', array( 'module' => 'core', 'controller' => 'pagine', 'action' => 'view' ), array( 'ident' => '[a-zA-Z-_0-9]{3,}', 'language' => '[a-z]{2}' ) ); $registrazione = new Zend_Controller_Router_Route( ':language/@utenti/@registrati', array( 'module' => 'core', 'controller' => 'utenti', 'action' => 'registrazione' ), array( 'language' => '[a-z]{2}' ) ); $router->addRoute('page', $page); $router->addRoute('registrazione', $registrazione); ..... } I cannot set the default translator to Zend_Controller_Router_Route (for translated segments) because i don't know the language parameter in the request object. I get the language parameter in Multilanguage Plugin during the "routeShutdown": class Activa_Controller_Plugin_Multilanguage extends Zend_Controller_Plugin_Abstract { public function routeShutdown(Zend_Controller_Request_Abstract $request) { $language = $request->getParam("language"); $locale = new Zend_Locale($language); $translate = new Zend_Translate('array', APPLICATION_PATH.'/config/lang/'.$language.'.php', $locale); Zend_Registry::set('Zend_Locale', $locale); Zend_Registry::set('Zend_Translate', $translate); Zend_Controller_Router_Route::setDefaultTranslator($translate); //////////////////////// // BUT NOW IS TOO LATE //////////////////////// } When i type the address "http://servername/it/utenti/registrati" i get the exception with the message "Could not find a translator". How can i fix it? Antonio (Italy)

    Read the article

  • How can I check if Zend_Form_Elements has no decorators set

    - by jiewmeng
    I find that even if I just declare an element like $this->addElement('textarea', 'txt1'); I find that it already has decorators set Zend_Debug::dump($this->getElement('txt1')->getDecorators()); http://pastebin.com/7Y24g62w I want to test that I didn't set decorators using setDecorators() or using something like $this->addElement('textarea', 'txt1', array( 'decorators' => array(...) )); If I didn't set any decorators then apply default decorators, how can I do that. I want to apply default decorators per element basis, not using Zend_Form#setDisableLoadDefaultDecoraotrs()

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >