Search Results

Search found 1568 results on 63 pages for 'zend'.

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

  • PHP web application can't connect mysql installed with Zend Server CE on Mac OSX

    - by Kane
    I'm setting up development environment on Mac OSX. However the PHP web application can't connect the mysql server installed with Zend Server CE. The error information is below, [Type] dbnot_connect [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 61 Mysql database can be accessed via phpAdmin installed with Zend Server CE as well. The same code works well on Windows or Linux in Zend Server CE.

    Read the article

  • Trouble getting PHP, Apache, and Zend talking to eachother (localhost)

    - by Joel
    Hi guys, I've searched through several other questions, but haven't found my solution. THe main reason is that I'm not even sure if I have all these things properly installed. I have a hosting account, and have always just deployed everything into the internets, but I'm finally trying to figure out how to get my desktop set up right for learning Zend Framework. I have Apache Server 2.2, PHP, And Zend Framework installed. I'm trying to do this tutorial: http://akrabat.com/wp-content/uploads/Getting-Started-with-Zend-Framework.pdf The problem is when I click on the link: http://localhost/zf-tutorial/public I get an Error 404. If I type in http://www.localhost I get "It Works!" in the browser. I'm thinking this means I have Apache installed correctly, but am not pointing correctly to the Zend tutorial? Thanks for any help!

    Read the article

  • Zend form and dynamic file upload

    - by DoomStone
    Hello there i'm trying to create a form with Zend_Form that will enable my user to upload a unlited number of files to my site, witch is done by javascript. Something like <script type="text/javascript"> $(document).ready(function(){ var image_uploade_i = 0; $('#upload_more').click(function() { image_uploade_i++; $('#upload_list').append('<div id="image_uploade_id_'+image_uploade_i+'" style="display: none;"><input type="file" name="image[]" /><br /></a>'); $('#image_uploade_id_'+image_uploade_i).slideDown('slow'); }); }); </script> <?=$this->translate('Add images')?> <form action="" method="post" enctype="multipart/form-data"> <div id="upload_list"> <input type="file" name="image[]" /><br /> <input type="file" name="image[]" /><br /> <input type="file" name="image[]" /><br /> </div> <a href="#" id="upload_more"><?=$this->translate('Upload another image')?></a><br /> <input type="submit" name="image_uploade" value="<?=$this->translate('Upload images')?>" /> </form> But i'm am unable to find out how i can create something like this with Zend_From, the only reason i want to use Zend_Form on this thoug is for validation of the uploadet files. $element = new Zend_Form_Element_File('image'); $element->setRequired(true) ->setLabel('Profile image') ->setDestination($store) ->setValueDisabled(true) ->addValidator(new Zend_Validate_File_ImageSize(array( 'minheight' => 100, 'minwidth' => 150, 'maxheight' => 1920, 'maxwidth' => 1200))) // File must be below 1.5 Mb ->addValidator(new Zend_Validate_File_FilesSize(array('max' => 1572864))) ->addValidator(new Zend_Validate_File_IsImage()); If any 1 can help me set this up would i be verry great full :D

    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

  • Extending Zend View Helper Placeholder

    - by Sonny
    I was reading the manual about basic placeholder usage, and it has this example: class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { // ... protected function _initSidebar() { $this->bootstrap('View'); $view = $this->getResource('View'); $view->placeholder('sidebar') // "prefix" -> markup to emit once before all items in collection ->setPrefix("<div class=\"sidebar\">\n <div class=\"block\">\n") // "separator" -> markup to emit between items in a collection ->setSeparator("</div>\n <div class=\"block\">\n") // "postfix" -> markup to emit once after all items in a collection ->setPostfix("</div>\n</div>"); } // ... } I want to acommplish almost exactly that, but I'd like to conditionally add more class values to the repeating divs, at time of rendering if possible, when all the content is in the placeholder. One thing I specifically want to do is add the class of "first" to the first element and "last" to the last element. I assume that I'll have to extend the Zend_View_Helper_Placeholder class to accomplish this.

    Read the article

  • Zend Framework problems using Element, sub-forms and belongsTo

    - by wiseguydigital
    Still pulling my hair out with Zend_Form and any elements that need to be placed in a sub-array. form-populate() does not work when working with elements within a sub-form that have been set to a parent array using belongsTo() - I think it is actually a bug in Zend_Form-setDefaults() but just wanted to see if anyone else has a) had the same problem and b) managed to work around it...

    Read the article

  • Zend routing, throws resource not found

    - by bluedaniel
    Ive got a url: http://dev.local/foodies/view?id=bluedaniel and ive got in my bootstrap: protected function _initRoute() { $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/routes.ini', 'production'); $router = new Zend_Controller_Router_Rewrite(); $router->addConfig($config, 'resources'); } and ive also got in my routes.ini: [production] resources.router.routes.foodies_view.route = ":foodies/:id" resources.router.routes.foodies_view.defaults.module = "foodies" resources.router.routes.foodies_view.defaults.controller = "view" resources.router.routes.foodies_view.defaults.action = "index" so http://dev.local/foodies/bluedaniel should work right? I get a Resource 'foodies:bluedaniel' not found error however with this setup

    Read the article

  • Zend Router Route Regex with Search params

    - by balan-mahadevan
    Hi , Trying to grab the params after ?. I need them to add to the Zend_Paginator. ex: http://www.example.com/test/show?name=xxx&age=20&sex=m Building a paginator for search results. Is there any solution for that ? $router = new Zend_Controller_Router_Route_Regex( 'test/show\?(.*)', array( 'controller' = 'test', 'action' = 'show', 'module' = 'user' ), array( 1 = 'q' ), 'test/show%s' ); $router_prev->addRoute('view',$router);

    Read the article

  • 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

  • How to search inbox using zend mail

    - by Bob Cavezza
    The following is a function from zend_mail_protocol_imap. i read that to search emails, I would want to override it using zend_mail_storage_imap (which is what I'm using now to grab email from gmail). I copy and pasted the following function into zend_mail_storage_imap, but I'm having issues with the params. I can't find documentation on what to use for the array $params. I initially thought it was the search term before reading it more thoroughly. I'm out of ideas. Here's the function... /** * do a search request * * This method is currently marked as internal as the API might change and is not * safe if you don't take precautions. * * @internal * @return array message ids */ public function search(array $params) { $response = $this->requestAndResponse('SEARCH', $params); if (!$response) { return $response; } foreach ($response as $ids) { if ($ids[0] == 'SEARCH') { array_shift($ids); return $ids; } } return array(); } Initially I thought this would do the trick... $storage = new Zend_Mail_Storage_Imap($imap); $searchresults = $storage->search('search term'); But nope, I need to send the info in an array. Any ideas?

    Read the article

  • Zend Framework Zend_Form Decorators: <span> Inside Button Element?

    - by leek
    I have a button element that I've created like so: $submit = new Zend_Form_Element_Button('submit'); $submit->setLabel('My Button'); $submit->setDecorators(array( 'ViewHelper', array('HtmlTag', array('tag' => 'li')) )); $submit->setAttrib('type', 'submit'); This generates the following HTML: <li> <label for="submit" class="optional">My Button</label> <button name="submit" id="submit" type="submit">My Button</button> </li> I would like to wrap the inside of the button with a <span, like this: <button...><span>My Button</span></button> What is the best way to do this using Zend_Form?

    Read the article

  • Zend Framework: Autoloading module resources in config.ini?

    - by Olagato
    Is it possible, to configure the following behaviour in application.ini? <?php class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected function _initAdminModuleAutoloader() { $this->_resourceLoader = new Zend_Application_Module_Autoloader(array( 'namespace' => 'Admin', 'basePath' => APPLICATION_PATH . '/modules/admin', )); $this->_resourceLoader->addResourceTypes(array( 'model' => array( 'namespace' => 'Model', 'path' => 'models' ) )); } } ?> If so, can you please show us an example? Thanks.

    Read the article

  • Zend Framework: Zend_DB Error

    - by Sergio E.
    I'm trying to learn ZF, but got strange error after 20 minutes :) Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'Configuration array must have a key for 'dbname' that names the database instance' What does this error mean? I got DB information in my config file: resources.db.adapter=pdo_mysql resources.db.host=localhost resources.db.username=name resources.db.password=pass resources.db.dbname=name Any suggestions? EDIT: This is my model file /app/models/DbTable/Bands.php: class Model_DbTable_Bands extends Zend_Db_Table_Abstract { protected $_name = 'zend_bands'; } Index controller action: public function indexAction() { $albums = new Model_DbTable_Bands(); $this->view->albums = $albums->fetchAll(); } EDIT All codes: bootstrap.php protected function _initAutoload() { $autoloader = new Zend_Application_Module_Autoloader(array( 'namespace' => '', 'basePath' => dirname(__FILE__), )); return $autoloader; } protected function _initDoctype() { $this->bootstrap('view'); $view = $this->getResource('view'); $view->doctype('XHTML1_STRICT'); } public static function setupDatabase() { $config = self::$registry->configuration; $db = Zend_Db::factory($config->db); $db->query("SET NAMES 'utf8'"); self::$registry->database = $db; Zend_Db_Table::setDefaultAdapter($db); Zend_Db_Table_Abstract::setDefaultAdapter($db); } IndexController.php class IndexController extends Zend_Controller_Action { public function init() { /* Initialize action controller here */ } public function indexAction() { $albums = new Model_DbTable_Bands(); $this->view->albums = $albums->fetchAll(); } } configs/application.ini, changed database and provided password: [development : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 db.adapter = PDO_MYSQL db.params.host = localhost db.params.username = root db.params.password = pedro db.params.dbname = test models/DbTable/Bands.php class Model_DbTable_Bands extends Zend_Db_Table_Abstract { protected $_name = 'cakephp_bands'; public function getAlbum($id) { $id = (int)$id; $row = $this->fetchRow('id = ' . $id); if (!$row) { throw new Exception("Count not find row $id"); } return $row->toArray(); } }

    Read the article

  • How do I reuse code in Zend Framework

    - by Mario
    I am working on a web application which requires the user to login before they see or do anything. No part of this app should be accessible without being logged in. (Except of course, the login controller) Currently I am using sessions to handle the authentication and I have put code in each controller in the init() function to check if their session is valid. This was a temporary workaround, but it is redundant and inefficient. I would like my init() function to be similar to the following, but I am not sure how to achieve it: public function init() { // If user not logged in redirect to login controller $myLibrary = Zend_Library_MyLibrary(); $myLibrary->CheckAuth(); } So my question really has two parts: Where is the best place to store code that will be used in multiple controllers? How do I then call that function from a controller? Thanks.

    Read the article

  • Zend Routes conflict

    - by meder
    I have defined 2 custom routes. One for threads/:id/:name and the other for threads/tags/:tagName however the second one conflicts with the first because if I enable both then the first breaks and treats :id literally as an action, not obeying the \d+ requirement ( I also tried using pure regex routes, see bottom ). Action "1" does not exist and was not trapped in __call() I tried re-arranging the order of the routes but if I do that then the threads/tags/:tagName doesnt correctly capture the tagName. I also tried disabling default routes but the routes still don't properly work after that. Here's my route init function: protected function _initRoutes() { $fc = Zend_Controller_Front::getInstance(); $router = $fc->getRouter(); $router->addRoute( 'threads', new Zend_Controller_Router_Route('threads/:id/:name', array( 'controller' => 'threads', 'action' => 'thread', ), array( 'id' => '\d+' ) ) ); $router->addRoute( 'threads', new Zend_Controller_Router_Route('threads/tags/:tagName', array( 'controller' => 'threads', 'action' => 'tags', ), array( 'tagName' => '[a-zA-Z]+' ) ) ); } I also tried using a pure regex route but was unsuccessful, most likely because I did it wrong: $router->addRoute( 'threads', new Zend_Controller_Router_Route_Regex( 'threads/(\d+)/([a-zA-Z]+)', array( 'controller' => 'threads', 'action' => 'thread', ), array( 1 => 'tagName', 2 => 'name' ) ) );

    Read the article

  • Zend Framework - Database Table Singleton

    - by Sonny
    I have found myself doing this in my code to 'cache' the work done when instantiating my Zend_Db_Table models: if (Zend_Registry::isRegistered('x_table')) { $x_table = Zend_Registry::get('x_table'); } else { $x_table = new Default_Model_DbTable_X; Zend_Registry::set('x_table', $x_table); } It bothered me that this method isn't very DRY and it dawned on me today that a singleton pattern would probably be a better way to do this. Problem is, I've never written a singleton class. When I did some web searches, I found some offhand comments about Zend_Db_Table singletons, but no real examples. I already have meta-data caching configured. How do I make my Zend_Db_Table models singletons? Are there pitfalls or downsides?

    Read the article

  • Can't retrieve more than 2 gmail messages using Zend framework imap access - server dies - doens't r

    - by Ali
    Hi guys I'm working on a google apps application. Basically I've set it up so users can add multiple gmail addresses and check on their inboxes in the application. It works fine with a google apps email address however when I add a gmail address it just dies out. I'm using this code here: $mail = new Zend_Mail_Storage_Imap($mail_options); $all_messages = array(); $page = isset($_GET['page'])?$_GET['page']:1; $limit = isset($_GET['limit'])?$_GET['limit']:20; $offset = (($page-1)*$limit)+1; $end = ($page*$limit)>$c?$c:($page*$limit); for ($i=$offset;$i<=$end;$i++){ $h2t = new html2text(); $h2t->set_allowed_tags('<a>'); if(!$mail[$i]) break; else{ $one_message = $mail->getMessage($i); $one_message->id = $i; $one_message->UID = $mail->getUniqueId($i); $one_message->parts = array(); $one_message->body = ''; $count = 1; foreach (new RecursiveIteratorIterator($mail->getMessage($i)) as $ii=>$part) { try { $tpart = $part; //$tpart->_content = ''; $one_message->parts[$count] = $tpart; $count++; // check for html body if (strtok($part->contentType, ';') == 'text/html') { $b = $part->getContent(); if($part->contentTransferEncoding == 'quoted-printable') $b = quoted_printable_decode($b); $one_message->html_body = $b; $h2t->set_html($b); $one_message->body = $h2t->get_text(); } //check for text body if (strtok($part->contentType, ';') == 'text/plain') { $b = $part->getContent(); if($part->contentTransferEncoding == 'quoted-printable') $b = quoted_printable_decode($b); $one_message->text_body = $b; $one_message->body = $b;//$part->getContent(); } } catch (Zend_Mail_Exception $e) { // ignore } } $all_messages[] = $one_message; } } No matter what the emails it dies out on retrieving just 2 emails... whats going on here?

    Read the article

  • how to delete findDependentRowset result in Zend Framework

    - by Behrang
    I have place model & entry model that entry is parent everything is fine but how can I delete the result row $categoryPlacements in place model: $entryModel = new Model_EntryModel(); $entryRow = $entryModel-find ( $entryId )-current (); $categoryPlacements = $entryRow-findDependentRowset($this); in this case i want to delete the $categoryPlacements result in place model I can use categoryPlacements-toarray() and then delete but is another easy way?

    Read the article

  • Zend Framework Custom Validation Class Error Message

    - by remlabm
    The validation fails as it should but does not return the error message. $form->addElement('text', 'phone_number', array( 'required' => true, 'validators' => array( array('NotEmpty', true, array('messages' => 'Enter a valid Phone Number')), array('regex', false, array('pattern' => '/\([0-9]{3}\)\s[0-9]{3}-[0-9]{4}/', 'messages' => 'Enter a valid Phone Number' )), 'CheckPhoneNumber'), ), )); Custom Class: class Custom_Validators_CheckPhoneNumber extends Zend_Validate_Abstract{ const IN_USE = 'inUse'; protected $_messageTemplates = array( self::IN_USE => "'%value%' is currently in use" ); public function isValid($value) { $this->_setValue($value); $user_check = Users::getActive(preg_replace("/[^0-9]/", "", $value)); if($user_check->id){ $this->_error(self::IN_USE); return false; } return true; } } Just fails does not give the "IN_USE" error.

    Read the article

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