Search Results

Search found 13663 results on 547 pages for 'zend framework'.

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

  • How to get my list of rows from database to show while using Zend-Paginator

    - by Matto
    I'm fairly new to the world of Zend-Framework, and have taken over a site that is in zend-framework. There is a bug on one of the pages right now and I can not figure it out. I think it has something to do with Zend Paginator, but not sure. This is the code in the controller for the section I am having a problem with: $currentPage = $this->_getParam('page'); $numWebsitesFullOnline = $websites->getWebsitesFullOnline(); $select = $websites->select(); $select->setIntegrityCheck(false); $select->from(array('w' => 'websites'), array('id', 'online', 'kw_adjective', 'kw_name', 'kw_location', 'url', 'email', 'address', 'ftp_server', 'ftp_username', 'ftp_password', 'ftp_folder', 'phone_number', 'indexed', 'youtube_position', 'twitter_user', 'facebook_id', 'video_made', 'image1_id', 'image2_id', 'image3_id', 'bg_color', 'dark_color', 'light_color', 'links_color', 'text_color', 'google_account', 'ganalytics', 'gmaps_status', 'google_position', 'gmap_position', 'hp1', 'hp2', 'hp3', 'hp4', 'hp5', 'hp6', 'hp7', 'hp8', 'hp9', 'hp10', 'about1_id', 'about2_id', 'about3_id', 'tip1_id', 'tip2_id', 'tip3_id', 'contact_texts_id', 'quote_texts_id', 'demographics_id')) ->join(array('d' => 'demographics'), 'w.demographics_id = d.id', array('total_population')) ->order(array('total_population DESC', 'kw_location')); $paginator = new Zend_Paginator(new Zend_Paginator_Adapter_DbSelect($select)); $paginator->setItemCountPerPage(50); $paginator->setCurrentPageNumber($currentPage); $paginator->setPageRange(($paginator->getTotalItemCount() / 50) + 1); $this->view->paginator = $paginator; $numWebsitesOnline = $websites->getWebsitesOnline(); On the php page I have this code to call the websites that are in the database to a list: <p class="red"> Websites online: <?php echo $this->numOnline; ?> </p> <?php print_r(count($this->paginator)); ?> <?php if(count($this->paginator)): ?> <table class="table-list"> <?php foreach($this->paginator as $item): ?> <tr> <?php if($this->userIsAllowedAction('websites', 'reload')): ?> <td class="center noborder w30"> <img class="hidden" src="<?php echo $this->baseUrl() . '/images/loader.gif' ?>" alt="Loading..."/><a class="reload" title="refresh" href="<?php echo $this->baseUrl(); ?>/utils/ui/refresh-website.php" rel="<?php echo urlencode('http://' . $item['url'] . '/install.php'); ?>,<?php echo urlencode($item['ftp_server']); ?>,<?php echo $item['ftp_username']; ?>,<?php echo $item['ftp_password']; ?>,<?php echo $item['ftp_folder']; ?>,<?php echo $this->baseUrl(); ?>,<?php echo $item['id']; ?>"><img src="<?php echo $this->baseUrl(); ?>/images/icon-refresh.png" alt="Refresh"/></a> </td> <?php endif; ?> <td class="center noborder w30"> <?php if($this->userIsAllowedAction('websites', 'edit')): ?><a title="Edit" href="<?php echo $this->url(array('controller' => 'websites', 'action' => 'edit', 'id' => $item['id'])); ?>"><img src="<?php echo $this->baseUrl(); ?>/images/icon-edit.png" alt="Edit"/></a><?php endif; ?> </td> <td class="center noborder w30"> <?php if($this->userIsAllowedAction('websites', 'remove')): ?><a title="Remove" href="<?php echo $this->url(array('controller' => 'websites', 'action' => 'remove', 'id' => $item['id'])); ?>"><img src="<?php echo $this->baseUrl(); ?>/images/icon-delete.png" alt="Remove"/></a><?php endif; ?> </td> <td> <?php if($item['online']): ?> <span class="hidden"><?php echo trim($this->escape($item['kw_adjective'] . $item['kw_name'])); ?></span><a class="goto-website" href="http://<?php echo $item['url']; ?>" target="_blank"><?php echo $this->escape($item['kw_location']); ?></a> <?php else: ?> <?php echo $this->escape($item['kw_location']); ?> <?php endif; ?> </td> <td class="center population"> <?php if($item['total_population'] >= 0) echo $item['total_population']; ?> </td> <td class="center"> <?php if(!empty($item['url'])): ?><img src="<?php echo $this->baseUrl(); ?>/images/check_mark.png" alt="DONE"/><?php endif; ?> </td> <td class="center"> <?php if(!empty($item['email'])): ?><img src="<?php echo $this->baseUrl(); ?>/images/check_mark.png" alt="DONE"/><?php endif; ?> </td> <td class="center"> <?php if($item['demographics_id']): ?><img src="<?php echo $this->baseUrl(); ?>/images/check_mark.png" alt="DONE"/><?php endif; ?> </td> <td class="center"> <?php if($item['hp1'] && $item['hp2'] && $item['hp3'] && $item['hp4'] && $item['hp5'] && $item['hp6'] && $item['hp7'] && $item['hp8'] && $item['hp9'] && $item['hp10'] && $item['about1_id'] && $item['about2_id'] && $item['about3_id'] && $item['tip1_id'] && $item['tip2_id'] && $item['tip3_id'] && $item['contact_texts_id'] && $item['quote_texts_id']): ?><img src="<?php echo $this->baseUrl(); ?>/images/check_mark.png" alt="DONE"/><?php endif; ?> </td> <td class="center"> <?php if(file_exists($_SERVER['DOCUMENT_ROOT'] . $this->baseUrl() . Zend_Registry::get('assets_base_path') . '/' . $item['id'] . '/header.jpg')): ?><img src="<?php echo $this->baseUrl(); ?>/images/check_mark.png" alt="DONE"/><?php endif; ?> </td> <td class="center"> <?php if(($item['bg_color'] != '' && $item['bg_color'] != 'e6e6e6') || ($item['dark_color'] != '' && $item['dark_color'] != '003e75') || ($item['light_color'] != '' && $item['light_color'] != '3073ad') || ($item['links_color'] != '' && $item['links_color'] != '255593') || ($item['text_color'] != '' && $item['text_color'] != '4f4f4f')): ?> <img src="<?php echo $this->baseUrl(); ?>/images/check_mark.png" alt="DONE"/> <?php endif; ?> </td> <td class="center"> <?php if($item['image1_id'] && $item['image2_id'] && $item['image3_id']): ?><img src="<?php echo $this->baseUrl(); ?>/images/check_mark.png" alt="DONE"/><?php endif; ?> </td> <td class="center"> <?php if(!empty($item['twitter_user'])): ?><img src="<?php echo $this->baseUrl(); ?>/images/check_mark.png" alt="DONE"/><?php endif; ?> </td> <td class="center"> <?php if(!empty($item['facebook_id'])): ?><img src="<?php echo $this->baseUrl(); ?>/images/check_mark.png" alt="DONE"/><?php endif; ?> </td> <td class="center"> <?php if(!empty($item['phone_number'])): ?><img src="<?php echo $this->baseUrl(); ?>/images/check_mark.png" alt="DONE"/><?php endif; ?> </td> <td class="center"> <?php if($item['google_account']): ?><img src="<?php echo $this->baseUrl(); ?>/images/check_mark.png" alt="DONE"/><?php endif; ?> </td> <td class="center"> <?php if($item['video_made']): ?><img src="<?php echo $this->baseUrl(); ?>/images/check_mark.png" alt="DONE"/><?php endif; ?> </td> <td class="center"> <?php if($item['youtube_position']) { echo $item['youtube_position']; }; ?> </td> <td class="center"> <?php if(!empty($item['address'])): ?><img src="<?php echo $this->baseUrl(); ?>/images/check_mark.png" alt="DONE"/><?php endif; ?> </td> <td class="center"> <?php if($item['gmaps_status'] == 1): ?><img src="<?php echo $this->baseUrl(); ?>/images/icon-gmapspending.png" alt="Pending"/><?php elseif($item['gmaps_status'] == 2): ?><img src="<?php echo $this->baseUrl(); ?>/images/check_mark.png" alt="DONE"/><?php endif; ?> </td> <td class="center"> <?php if(!empty($item['ganalytics'])): ?><img src="<?php echo $this->baseUrl(); ?>/images/check_mark.png" alt="DONE"/><?php endif; ?> </td> <td class="center"> <?php if($item['online']): ?><img src="<?php echo $this->baseUrl(); ?>/images/check_mark_red.png" alt="Online!"/><?php endif; ?> </td> <td class="center"> <?php if($item['indexed']): ?><img src="<?php echo $this->baseUrl(); ?>/images/check_mark_red.png" alt="Online!"/><?php endif; ?> </td> <td class="center"> <?php if($item['gmap_position']) { echo $item['gmap_position']; }; ?> </td> <td class="center"> <?php if($item['google_position']) { echo $item['google_position']; }; ?> </td> </tr> <?php endforeach; ?> </table> <?php endif; ?> The print_r(count($this-paginator)); line is returning "0", and the $this-numOnline; line is returning 1. So it sees that there is one row in the websites table of the database, but it is not returning anything to page and listing out the rows in the websites table. Not sure if this is the paginator that is causing this cause it is returning 0 or something else I don't know about.

    Read the article

  • mysql.sock problem on Mac OS X, all Zend products

    - by Michael Stelly
    Hi folks. I posted this on the Zend forum, but I'm hoping I can get a speedier reply here. I've tried every solution provided on this forum with no luck. When I restart mysql, everything appears ok. sudo /usr/local/zend/bin/zendctl.sh restart Password: /usr/local/zend/bin/apachectl stop [OK] /usr/local/zend/bin/apachectl start [OK] Stopping Zend Server GUI [Lighttpd] [OK] spawn-fcgi: child spawned successfully: PID: 7943 Starting Zend Server GUI [Lighttpd] [OK] Stopping Java bridge [OK] Starting Java bridge [OK] Shutting down MySQL . SUCCESS! Starting MySQL . SUCCESS! Pinging locahost is also OK and resolve dns to IP. ping localhost PING localhost (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.048 ms 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.064 ms 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.066 ms 64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.076 ms 64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.064 ms But when I attempt to access the local url for my app, I get the dreaded: Message: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2). This is a show-stopper for me. I appreciate any assistance. Thank you.

    Read the article

  • Developing high-performance and scalable zend framework website [on hold]

    - by Daniel
    We are going to develop an ads website like http://www.gumtree.com/ (it will not be like this one but just to give you an ideea) and we are having some issues regarding performance and scalability. We are planning on using Zend Framework for this project but this is all that I'm sure off at this point. I don't think a classic approch like Zend Framework (PHP) + MySQL + Memcache + jQuery (and I would throw Doctrine 2 in there to) will fix result in a high-performance application. I was thinking on making this a RESTful application (with Zend Framework) + NGINX (or maybe MongoDB) + Memcache (or eAccelerator -- I understand this will create problems with scalability on multiple servers) + jQuery or maybe throw Backbone.js in there, a CDN for static content, a server for images and a scalable server for the requests and the rest. My questions are: - What do you think about my approch? - What solutions would you recommand for developing an high performance, scalable application expected to have a lot of traffic using PHP(Zend Framework 2)...I would be interested in your approch. I should note that I'm a Zend developer, I'm working with Zend for over 3 years, this is why I'm choosing it.

    Read the article

  • using zend form decorators

    - by pradeep
    <div class="field50Pct"> <div class="fieldItemLabel"> <label for='First Name'>First Name:</label> </div> <div class="fieldItemValue"> <input type="text" id="firstname" name="firstname" value="" /> </div> </div> <div class="clear"></div> I want the code to appear like this in source code . how do i write the same thing in zend using decorators ? The element is like $firstname = new Zend_Form_Element_Text('FirstName'); $firstname->setLabel('FirstName') ->setRequired(true) ->addFilter('StripTags') ->addFilter('StringTrim') ->addErrorMessage('Error in First Name') ->addValidator('NotEmpty');

    Read the article

  • Zend DB MYSQL Wrapper

    - by Vincent
    All, I have a PHP application written in Zend Framework with MVC style. I plan to use Zend_DB to connect to the MySQL database and process queries. I am looking for a wrapper class which makes it easy to use Zend_DB class. This wrapper class will have a constructor that connects to the Mysql db using Zend_DB. It will also have a method to return a singleton instance for each and every db connection made. Something like: $pptDB = PPTDB::getInstance(); $pptDB->setFetchMode(PPTDB::FETCH_OBJ); $result = $pptDB->fetchRow('SELECT * FROM bugs WHERE bug_id = 2'); echo $result->bug_description; Where class PPTDB extends Zend_DB Is this something feasible to have? If not, how ls would you use Zend_DB in a major application? Thanks,

    Read the article

  • Zend RegEx Validator error message issue

    - by Mallika Iyer
    Hello, I'm validating a text field in my form as follows: $name = new Zend_Form_Element_Text('name'); $name->setLabel('First Name:') ->setRequired(true) ->addFilter(new Zend_Filter_StringTrim()) ->addValidator('regex',true,array('/^[(a-zA-Z0-9)]+$/')) ->addErrorMessage('Please enter a valid first name'); What I'm trying to accomplish is - how can i display a meaningful error message? Eg: If first name is 'XYZ-', how can i display '- is not allowed in first name.' Is there a way I can access what character the regex is failing for? Would you recommend something else altogether? I thought about writing a custom validator but the regex is pretty simple, so I don't see the point. I couldn't find a decent documentation for the zend 'regex' validator anywhere. If I don't override the default error message, I simple get something like : ';;;hhbhbhb' does not match against pattern '/^[(a-zA-Z0-9)]+$/' - which I obviously don't want to display to the user. I'd appreciate your inputs.

    Read the article

  • Best way to deal with session handling in Zend Framework

    - by JACK IN THE CRACK
    So I'm starting up in Zend framework and looking to implement a site-wide "User" session.... something I can easily access from ALL modules/controllers in the application. I'm like, should I make a new namespace in the library and extend the controller, like: MyLib_Controller_Action extends Zend_Controller_Action { protected $_userSession; function preDispatch(Zend_Controller_Request_Abstract $req) { $this->_userSession = new Zend_Session_Namespace('user'); } } ANd then have all my controllers/modules/etc extend from that? Or should I create a Plugin or what? How would you go about making this plugin to pass the user session to the controller? Or do I do it in the bootstrap?? Again how to pass to controller? Also should I use Zend_Session_Namespace or Zend_Http_Cookie and also how do I encrypt and xss clean the cookie or is that did automagically?

    Read the article

  • Disable escape in Zend Form Element Submit

    - by Joaquín L. Robles
    I can't disable escaping in a Zend_Form_Element_Submit, so when the label has special characters it won't display it's value.. This is my actual Zend Form piece of code: $this->submit = new Zend_Form_Element_Submit('submit'); $this->submit->setLabel('Iniciar Sesión'); $this->submit->setIgnore(true); $this->addElement($this->submit); I've tried $this->submit->getDecorator('Label')->setOption('escape', false); but I obtain an "non-object" error (maybe submit isn't using the "Label" Decorator).. I've also tried as suggested $this->submit->setAttrib('escape', false); but no text will be shown either.. Any idea? Thanks

    Read the article

  • Where do DQL statements live in an application that is using Zend Framework and Doctrine

    - by Dewayne
    In an application that is using Zend Framework 1.10 and Doctrine 1.2, where should the DQL statements live if our application is built such that it has a Service Layer and a Gateway(aka Doctrine_Table) layer. It seems that our possibilities include: 1) Placing the DQL statements in the Service layer which seems to be a bit too high in our application hierarchy to store DQL. 2) Placing the DQL statements within each model's Table/Gateway which seems a bit redundant because we also need to expose the DQL statements that do things such as getAllUsers() through the Service layer. Which of these is a preferable design? We intend to make use of the Service layer as much as possible so that other projects might consume various parts of our application.

    Read the article

  • How to add/register helpers with Zend Framework

    - by manyxcxi
    I'm just starting out with Zend Framework and am having issues using Zend_Controller_Action_HelperBroker::addPath() to add helpers. I'm not sure if my classes are named incorrectly, I'm giving it the wrong prefix, or what I'm doing wrong so I will post the code and file structure and get out of the way. In Bootstrap.php public function __construct($application) { ... // This works with a manual include_once('../application/plugins/helpers/Csrf.php'); //Zend_Controller_Action_HelperBroker::addHelper(new Application_Controller_Action_Helper_Csrf()); // This isn't picking up my helper class automagically Zend_Controller_Action_HelperBroker::addPath('../application/plugins/helpers','Application_Controller_Action_Helper'); ... } In application/plugins/helpers/Csrf.php class Application_Controller_Action_Helper_Csrf extends Zend_Controller_Action_Helper_Abstract { ... } My directory tree: / application/ ... plugins/ helpers/ Csrf.php CsrfProtect.php ...

    Read the article

  • Zend DB inserting relational data

    - by Wimbjorno
    I'm using the Zend Framework database relationships for a couple of weeks now. My first impression is pretty good, but I do have a question related to inserting related data into multiple tables. For a little test application I've related two tables with each other by using a fuse table. +---------------+ +---------------+ +---------------+ | Pages | | Fuse | | Prints | +---------------+ +---------------+ +---------------+ | pageid | | fuseid | | printid | | page_active | | fuse_page | | print_title | | page_author | | fuse_print | | print_content | | page_created | | fuse_locale | | ... | | ... | | ... | +---------------+ +---------------+ +---------------+ Above is an example of my DB architecture Now, my problem is how to insert related data to two separate tables and insert the two newly created ID's into the fuse table at the same time. If someone could could maybe explain or give me a topic related tutorial. I would appreciate it!

    Read the article

  • Zend Framework how to echo value of SUM query

    - by Rick de Graaf
    Hello, I created a query for the zend framework, in which I try to retrieve the sum of a column, in this case the column named 'time'. This is the query I use: $this->timequery = $this->db_tasks->fetchAll($this->db_tasks->select()->from('tasks', 'SUM(time)')->where('projectnumber =' . $this->value_project)); $this->view->sumtime = $this->timequery; Echoing the query tells me this is right. But I can't echo the result properly. Currently I'm using: echo $this->sumtime['SUM(time)']; Returning the following error: Catchable fatal error: Object of class Zend_Db_Table_Row could not be converted to string in C:\xampp\htdocs\BManagement\application\views\scripts\tasks\index.phtml on line 46 Line 46 being the line with the echo in my view. I've been searching now for two days on how to figure this out, or achieve the same result in a different way. Tried to serialize the value, but that didn't work either. Is there somebody who knows how to achieve the total sum of a database column? Any help is greatly appriciated! note: Pretty new to zend framework...

    Read the article

  • Problems with zend-tool reporting that providers are not valid

    - by Mario
    I have recently setup XAMPP 1.7.3 and ZendFramework 1.10.4 on a new computer and many of the commands that I normally use now fail. Here are the steps I used to setup and test ZF. First I added the ZF library folder (C:\xampp\php\ZendFramework-1.10.4\library) to the include path in php.ini. Then I added the ZF bin folder (C:\xampp\php\ZendFramework-1.10.4\bin) to my Path system variable. To test that everything is configured correctly I ran the command "zf show version" from the command line. The result is "Zend Framework Version: 1.9.6". Immediately something appears to be wrong. The file that is downloaded is "ZendFramework-1.10.4.zip" and the reported version is 1.9.6. I have re-downloaded the latest version (1.10.4) and removed old copy. Still the incorrect version number problem persisted. Having done some research there is a bug in the ZF knowledgebase that version 1.10.3 reports a wrong version number. So that may explain the version number problem. Moving forward I tried to run some zf-tool commands and certain commands reports that the action or provider is not valid. Example: C:\xampp\htdocs>zf create project test Creating project at C:/xampp/htdocs/test C:\xampp\htdocs>cd test C:\xampp\htdocs\test>zf create controller Test Creating a controller at C:\xampp\htdocs\test/application/controllers/TestController.php ... Updating project profile 'C:\xampp\htdocs\test/.zfproject.xml' C:\xampp\htdocs\test>zf create action test Test Creating an action named test inside controller at C:\xampp\htdocs\test/application/controllers/TestController.php ... Updating project profile 'C:\xampp\htdocs\test/.zfproject.xml' C:\xampp\htdocs\test>zf enable layout An Error Has Occurred Action 'enable' is not a valid action. ... C:\xampp\htdocs\test>zf create form Test An Error Has Occurred Provider 'form' is not a valid provider. ... Can any one provide insight into these errors and how to correct them?

    Read the article

  • Zend Cache is not retrieving cache items after some period of time

    - by Phil
    Hi, I am using Zend Cache with page caching but it seems to miss the cache after a period of time. For a while it is OK, but I come back tomorrow and hit the page, it doesn't fetch the contents from the cache. why? $frontendOptions = array( 'content_type_memorization' => true, // This remembers the headers, needed for images 'lifetime' => NULL, // cache lifetime forever 'automatic_serialization' => true, 'automatic_cleaning_factor' => 0 ); $myPageCache = new Zend_Cache_Frontend_Page(array( 'debug_header' => false, 'automatic_cleaning_factor'=>0, 'content_type_memorization' => true, 'default_options' => array( 'cache' => true, 'cache_with_get_variables' => true, 'cache_with_post_variables' => true, 'cache_with_session_variables' => true, 'cache_with_cookie_variables' => true ))); $backendOptions = array('cache_dir' => '.' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR); $cache = Zend_Cache::factory($myPageCache, 'File', $frontendOptions, $backendOptions); $cacheKey = hash('md5', "cache_" . $cachePath); // cachePath is the key I use for the cache if(!$cache->start($cacheKey)) { I output html here $cache->end(); }

    Read the article

  • Zend Framework: How to start PHPUnit testing Forms?

    - by Andrew
    I am having trouble getting my filters/validators to work correctly on my form, so I want to create a Unit test to verify that the data I am submitting to my form is being filtered and validated correctly. I started by auto-generating a PHPUnit test in Zend Studio, which gives me this: <?php require_once 'PHPUnit/Framework/TestCase.php'; /** * Form_Event test case. */ class Form_EventTest extends PHPUnit_Framework_TestCase { /** * @var Form_Event */ private $Form_Event; /** * Prepares the environment before running a test. */ protected function setUp () { parent::setUp(); // TODO Auto-generated Form_EventTest::setUp() $this->Form_Event = new Form_Event(/* parameters */); } /** * Cleans up the environment after running a test. */ protected function tearDown () { // TODO Auto-generated Form_EventTest::tearDown() $this->Form_Event = null; parent::tearDown(); } /** * Constructs the test case. */ public function __construct () { // TODO Auto-generated constructor } /** * Tests Form_Event->init() */ public function testInit () { // TODO Auto-generated Form_EventTest->testInit() $this->markTestIncomplete( "init test not implemented"); $this->Form_Event->init(/* parameters */); } /** * Tests Form_Event->getFormattedMessages() */ public function testGetFormattedMessages () { // TODO Auto-generated Form_EventTest->testGetFormattedMessages() $this->markTestIncomplete( "getFormattedMessages test not implemented"); $this->Form_Event->getFormattedMessages(/* parameters */); } } so then I open up terminal, navigate to the directory, and try to run the test: $ cd my_app/tests/unit/application/forms $ phpunit EventTest.php Fatal error: Class 'Form_Event' not found in .../tests/unit/application/forms/EventTest.php on line 19 So then I add a require_once at the top to include my Form class and try it again. Now it says it can't find another class. I include that one and try it again. Then it says it can't find another class, and another class, and so on. I have all of these dependencies on all these other Zend_Form classes. What should I do? How should I go about testing my Form to make sure my Validators and Filters are being attached correctly, and that it's doing what I expect it to do. Or am I thinking about this the wrong way?

    Read the article

  • Zend Layout and Bootstrapping

    - by emeraldjava
    So i'm using the standard Zend Layout for my site. I have a number of custom controllers and views, and the content of these pages is displayed, but the details in the head element of the layout.phtml are not shown. Do i need to manually associate the Zend_Layout with each specific controller?. I expected since the layout is loaded via the bootstrap this should be available for free. My app.ini file has # layout resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts" resources.layout.layout = "layout" #resources.view[] = # Views resources.view.encoding = "UTF-8" resources.view.basePath = APPLICATION_PATH "/views/" my layout.phtml <?php echo $this->doctype() ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <?php echo $this->headTitle() ?> <?php echo $this->jQuery();?> </head> <!-- application/layouts/scripts/layout.phtml --> <body> <div id="content"> <?php echo $this->layout()->content ?> </div> </body>

    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 session exception on zend_session::start with forms

    - by Grant Collins
    Hi I'm having issues with trying to use Zend_Form_SubForm and sessions. My controller is in essance acting a wizard showing different subforms depending on the stage of the wizard. Using the example I am planning on storing the forms in a session namespace. My controller looks like this. include 'mylib/Form/addTaskWizardForm.php'; class AddtaskController extends Zend_Controller_Action{ private $config = null; private $log = null; private $subFormSession = null; /** * This function is called and initialises the global variables to this object * which is the configuration details and the logger to write to the log file. */ public function init(){ $this->config = Zend_Registry::getInstance()->get('config'); $this->log = Zend_Registry::getInstance()->get('log'); //set layout $this->_helper->layout->setLayout('no-sidemenus'); //we need to get the subforms and $wizardForms = new addTaskWizardForm(); $this->subFormSession = new Zend_Session_Namespace('addTaskWizardForms'); if(!isset($this->subFormSession->subforms)){ $this->subFormSession->subforms = $wizardForms; } } /** * The Landing page controller for the site. */ public function indexAction(){ $form = $this->subFormSession->subforms->getSubForm('start'); $this->view->form = $form; } However this is causing the application session to crash out with Uncaught exception 'Zend_Session_Exception' with message 'Zend_Session::start() Any idea why this is having issues with the Zend Session?? thanks.

    Read the article

  • identify accounts using zend-openid [HELP]

    - by tawfekov
    Hi! , i had successfully implemented simple open ID authentication with the [gmail , yahoo , myopenid, aol and many others ] exactly as stackoverflow do but i had a problem with identifying accounts for example 'openid_ns' => string 'http://specs.openid.net/auth/2.0' (length=32) 'openid_mode' => string 'id_res' (length=6) 'openid_op_endpoint' => string 'https://www.google.com/accounts/o8/ud' (length=37) 'openid_response_nonce' => string '2010-05-02T06:35:40Z9YIASispxMvKpw' (length=34) 'openid_return_to' => string 'http://dev.local/download/index/gettingback' (length=43) 'openid_assoc_handle' => string 'AOQobUf_2jrRKQ4YZoqBvq5-O9sfkkng9UFxoE9SEBlgWqJv7Sq_FYgD7rEXiLLXhnjCghvf' (length=72) 'openid_signed' => string 'op_endpoint,claimed_id,identity,return_to,response_nonce,assoc_handle' (length=69) 'openid_sig' => string 'knieEHpvOc/Rxu1bkUdjeE9YbbFX3lqZDOQFxLFdau0=' (length=44) 'openid_identity' => string 'https://www.google.com/accounts/o8/id?id=AItOawk0NAa51T3xWy-oympGpxFj5CftFsmjZpY' (length=80) 'openid_claimed_id' => string 'https://www.google.com/accounts/o8/id?id=AItOawk0NAa51T3xWy-oympGpxFj5CftFsmjZpY' (length=80) i thought that openid_claimed_id or openid_identity is identical for every account but after some testing turns out the claimed id is changeable by the users them self in yahoo and randomly changing in case of gmail FYI am using zend openid with a bit modification on consumer class and i can't use SERG [Simple Refistration Extension] cuz currently it uses openid v1 specification :( i hadn't read the specification of openid so if any body know please help me to how to identify openid accounts to know if this account has signed in before or not

    Read the article

  • using action helpers in Zend Framework 1.8

    - by Nasser
    Hi am starting off with Zend Framework and have a question about action helpers. My first application is a simple authentication system (following a tutorial from a book). The registration and authentication seems to work fine but the redirect doesn't. I have a customer controller that has this among others: class CustomerController extends Zend_Controller_Action { // some code here...... public function authenticateAction() { $request = $this->getRequest(); if (!$request->isPost()) { return $this->_helper->redirector('login'); } // Validate $form = $this->_forms['login']; if (!$form->isValid($request->getPost())) { return $this->render('login'); } if (false === $this->_authService->authenticate($form->getValues())) { $form->setDescription('Login failed, please try again.'); return $this->render('login'); } return $this->_helper->redirector('index'); } the authenticate url is http://localhost/customer/authenticate and this seems to work fine but it does not redirect. After authentication I get a blank page which looks like its taking me to the index and just sits there. I tried using '/index' instead but that did not help either. Do I need to do anything special to make the redirector helper work? I have a logout action which behaves the same.

    Read the article

  • How to use Zend Framework Form Hash (token) with AJAX

    - by nvoyageur
    I have included Zend_Form_Element_Hash into a form multiplecheckbox form. I have jQuery set to fire off an AJAX request when a checkbox is clicked, I pass the token with this AJAX request. The first AJAX request works great, but the subsequent ones fail. I suspect it may be once the token has been validated it is then removed from the session (hop = 1). What would be your plan of attack for securing a form with Zend Framework Hash yet using AJAX to complete some of these requests?

    Read the article

  • Validation framework for .NET Compact Framework 3.5.

    - by Michal Drozdowicz
    Do you know of a fast and simple entity validation framework that could be used in a Compact Framework project? I've done some experiments with FluentValidation (using db4o System.Linq.Expressions, but it's rather slow) and EViL (but it seems a bit half-baked). Can you suggest any other or maybe point me to some resources on how to design such a framework so that it's both easy to use and performant?

    Read the article

  • Best practice zend framework + faceBook Api

    - by simple
    What is better way to integrate facebook api, in zend framework, for login I can implement Zend_Auth_Adapter_Interface but I found something like Zend_Service_Twitter, and thinking if I should implement Zend_Service_interface and what are the odds, sorry haven't looked at the architecture of Zend_Service yet, but any advice would be appreciated and would save me time from going to wrong direction

    Read the article

  • How to move a google doc into a folder using Zend Gdata

    - by Andre
    Hi Guys I am really struggling with moving a document from my root folder to another folder using zend gdata here is how i am trying to do it, but its not working. $service = Zend_Gdata_Docs::AUTH_SERVICE_NAME; $client = Zend_Gdata_ClientLogin::getHttpClient($gUser, $gPass, $service); $link = "https://docs.google.com/feeds/documents/private/full/spreadsheet:0AUFNVEpLOVg2U0E"; // Not real id for privacy purposes $docs = new Zend_GData_Docs($client); // Attach a category object of folder to this entry // I have tried many variations of this including attaching label categories $cat = new Zend_Gdata_App_Extension_Category('My Folder Name','http://schemas.google.com/docs/2007#folder'); $entry = $docs->getDocumentListEntry($link); $entry->setCategory(array($cat)); $return = $docs->updateEntry($entry,$entry->getEditLink()->href); When I run this I get No errors, but nothing seems to change, and the return data does not contain the new category. EDIT: Ok I realised that its not the category but the link that decides which "collection" (folder) a resource belongs too. https://developers.google.com/google-apps/documents-list/#managing_collections_and_their_contents says that each resource has as et of parent links, so I tried changing my code to do set link instead of set category, but this did not work. $folder = "https://docs.google.com/feeds/documents/private/full/folder%3A0wSFA2WHc"; $rel = "http://schemas.google.com/docs/2007#parent"; $linkObj = new Zend_Gdata_App_Extension_Link($folder,$rel,'application/atom+xml', NULL,'Folder Name'); $links = $entry->getLink(); array_push($links,$linkObj); $entry->setLink($links); $return = $docs->updateEntry($entry,$entry->getEditLink()->href); EDIT: SOLVED [nearly] OK Here is how to move/copy, sort of, from one folder to another: simpler than initially thought, but problem is it creates a reference and NOT a move! It now in both places at the same time.... // Folder you wnat to move too $folder = "https://docs.google.com/feeds/folders/private/full/folder%asdsad"; $data = $docs->insertDocument($entry, $folder); // Entry is the entry you want moved using insert automatically assigns link & category for you...

    Read the article

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