Search Results

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

Page 30/452 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • Zend Framework: View variable in layout script is always null

    - by understack
    I set a view variable in someAction function like this: $this->view->type = "some type"; When I access this variable inside layout script like this: <?php echo $this->type ?> it prints nothing. What's wrong? My application.ini settings related to layout resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/" resources.layout.layout = "layout" ; changed 'default' to 'layout'

    Read the article

  • Zend Framework: How do I modify/format the form view generated with Zend_Dojo_Form elements

    - by pinardelrio
    I have created a form: <?php class Application_Form_Issue extends Zend_Dojo_Form { public function init() { $this->setName('issue'); $this->setMethod('post'); $id = new Zend_Form_Element_Hidden('id'); $id->addFilter('Int'); $date_recvd = new Zend_Dojo_Form_Element_DateTextBox('date_recvd'); $date_recvd->setLabel('Date Received') //->setRequired(true) /*->addValidator('NotEmpty'); */; More Form elements ... To view this form my view script is: <?php echo $this->form; ?> This all works just fine, with fully functional dojo form elements (datepicker, timepicker, etc) and successfully saving the data. However, now, I want to format the form that is generated with css. Such as grouping some elements and floating left or right, making some input text fields wider/narrower, etc. How? I realize I can modify the view script but it seems like that defeats the purpose of using Zend_Dojo_Form or Zend_Form. Is that a correct assumption?

    Read the article

  • MVC - thin controller idea - Codeigniter/Zend

    - by user505988
    Hi, Could some one possibly clarify this for me. In the MVC paradigm, the idea is to keep the controller as thin as possible, it is also true that the model is the bit that communicates with data sources such as the database, XML-RPC etc and this is where the business logic should go. Is the POST and GET data a 'data source' and should that kind of data be handled by the model or should it be by the controller. I would normally call a method in the model and pass it the post data, the data would be quality checked by the controller and the model method would simply do the insertion or whatever. Should it be though that controller just calls the model method if a post has occured and it is responsible for sanity check, data checks etc.

    Read the article

  • zend form check record no exists in database

    - by Yafa Su
    I have a form that check if email exists in the database within 2 tables. I'm using Zend_Validate_Db_NoRecordExists for both validate, but it only check the second one. Any idea why it's not working? class Application_Form_ReferUser extends Zend_Form { public $email, $freeDownload, $buyNow; public function init() { $this->setName('referUser'); $EmailExists = new Zend_Validate_Db_NoRecordExists( array( 'table' => 'referrals', 'field' => 'email' ) ); $EmailExists2 = new Zend_Validate_Db_NoRecordExists( array( 'table' => 'users', 'field' => 'email' ) ); $EmailExists->setMessage('This e-mail is already taken'); $EmailExists2->setMessage('This e-mail is already taken'); $this->email = $this->createElement('text', 'email') ->setLabel('Email') ->addValidator($EmailExists) ->addValidator($EmailExists2) ->addValidator('EmailAddress') ->setRequired(true); $this->freeDownload = $this->createElement('button', 'btn_free_download') ->setLabel('Free Download') ->setAttrib('type', 'submit'); $this->buyNow = $this->createElement('button', 'btn_buy_now') ->setLabel('Buy Now') ->setAttrib('type', 'submit'); $this->addElements(array($this->email, $this->freeDownload, $this->buyNow)); $elementDecorators = array( 'ViewHelper' ); $this->setElementDecorators($elementDecorators); } }

    Read the article

  • Unable to send an associative array in JSON format in Zend to client

    - by Anorflame
    Hi, In one of my actions in a controller, I'm using the json view helper to send back a response to an ajax request. On the client side I alert the data that is passed to the success callback function. It works fine as long as the response is a number or an array with default keys. Once I try to send an associative array, it alerts with [object Object]. Server code: $childArray = array('key'=>'value'); $this->_helper->json($childArray); javascript: function displayChildren(data){ alert(data); } ... $.ajax({ url: "/po/add", dataType: "json", data: {format: "json"}, success: displayChildren }); I have no idea what am I doing wrong here, so any help would be appreciated...

    Read the article

  • Generating a zend form with dynamic data?

    - by meder
    I need to access my session and based on the session property I need to grab stuff from the database to use as options in my dropdown. $_SESSION is: [sess_name] => Array( [properties] => Array( 1=> Hotel A, 2=> Hotel B ), [selected] => 1 ) I need to grab Hotel A from selected, and then access all accounts under Hotel A from the database: id title hotel_id ------------------------------ 1 Hotel A Twitter Account 1 2 Hotel B Facebook Account 2 3 Hotel A Facebook Account 1 I need ids 1 and 3 because my hotel_id is 1 in the context of: $this->addElement( 'select', 'account', array( 'multioptions' => $NEED_IT_HERE )); Here's my query / session grabbing code: $cs = new Zend_Session_Namespace( SESS_NAME ); $model = new Model_DbTable_Social; $s = " SELECT social_accounts.* FROM social_accounts LEFT JOIN social_media_outlets ON social_media_outlets.id = social_accounts.property WHERE social_accounts.property=".(int)$cs->selectedclient; I have this code in my form page, but I need to move it into my model now.

    Read the article

  • [Zend Framework] Forms and success output

    - by rasouza
    Well, It's a beginer's question but I really don't know what is the best way. I have a basic CRUD (Create, Retrieve, Update and Delete) in my project and I'd like to output some message if succeded or not in a div inside the same page. So, basically, I have a form which action is setted to the same page and I have a div #statusDiv below this same form which I'd like to output something like Register included with success. What is the best way for doing this? Set a flag in the controller $this->view->flagStatus = 'message' then call it in the view? Just to make it more clear. It's my code: //IndexController.php indexAction() ... //Check if there's submitted data if ($this->getRequest()->isPost()) { ... $registries->insert($data); $this->view->flagStatus = 'message'; $this->_redirect('/'); } Then my view: .... <?php if ($this->flagStatus) { ?> <div id="divStatus" class="success span-5" style="display: none;"> <?php echo $this->flagStatus; ?> </div> <?php } ?> ....

    Read the article

  • Question creating PDF document in Zend Framework

    - by deaddancer
    I need to take a ZF rendered view and create a PDF that should look pretty much exactly the same, and email it. The major issue I have right now is getting the HTML created by the view into a string that I can then process with the Zend_PDF::parse method. The view I need to turn into a PDF is the result of a posted form. I've tried grabbing the contents of ob_get_contents into a string after a successful post, but for some reason its not in there. Should I press on with this angle? Any help would be greatly appreciated!

    Read the article

  • Pass a variable from postDispatch() to view instance in Zend Framework

    - by takeshin
    I have a controller plugin with postDispatch() hook, and there I have a $variable. How to pass this variable to the view instance? I tried Zend_Layout::getMvcInstance()->getView(), but this returns new view instance (not the application resource). The same with $bootstrap->getResource('view'). I don't want to pass it as a request param. Now, as a workaround I do it using Zend_Registry. But, is it the best way?

    Read the article

  • Make a router like zend

    - by Vahan
    I have a url http://*.com/branch/module/view/id/1/cat/2/etc/3. It becomes. array ( 'module'=>'branch', 'controller'=>'module', 'action'=>'view' ); next I need to get the params. Ihave this array. /*function getNextSegments($n,$segments) { return array_slice ( $q = $this->segments, $n + 1 ); } $params = getNextSegments(3); */ array ( 0 => 'id', 1 => '1', 2 => 'cat', 3 => '2', 4 => 'etc', 5 => '3' );//params And i wanna convert it to this one: array ( 'id'=1, 'cat'=2, 'etc'=3, ); How i can do this using php function. I know I can do using for or foreach, but I think php has such function , but i cant find it :(. Thank you. class A { protected function combine($params) { $count = count ( $params ); $returnArray = array (); for($i = 0; $i < $count; $i += 2) { $g = $i % 2; if ($g == 0 or $g > 0) { if (isset ( $params [$i] ) and isset ( $params [$i + 1] )) $returnArray [$params [$i]] = $params [$i + 1]; } } return $returnArray; } } This works normaly. If anybody has better login for this please help. Thank you again.

    Read the article

  • Zend Framework How can I print a logged in user name from a Zend_Session_Namespace

    - by IrishStudent76
    Hi all I have created the following login controller for my site and it works fine in relation to logging users in a logging them out. The thing I want to do is echo the logged in users name into the FlashMessenger for the success page how ever as my code stands I only get the following message when redirected to the success page, "you have been successfully logged in as Array". Can I also ask the following does the line $session-user =$adaptergetResultArray('Password'); create an array of user information less the password value from the database. Many Thanks in advance, IrishStudent76 <?php class LoginController extends Zend_Controller_Action { public function init(){ $this->view->doctype('XHTML1_STRICT'); } // login action public function loginAction() { $form = new PetManager_Form_Login; $this->view->form = $form; /* check for valid input from the form and authenticate using adapter Add user record to session and redirect to the original request URL if present */ if ($this->getRequest()->isPost()) { if ($form->isValid($this->getRequest()->getPost())) { $values = $form->getValues(); $adapter = new PetManager_Auth_Adapter_Doctrine( $values['username'], $values['password'] ); $auth = Zend_Auth::getInstance(); $result = $auth->authenticate($adapter); if ($result->isValid()) { $session = new Zend_Session_Namespace('petmanager.auth'); $session->user = $adapter->getResultArray('Password'); if (isset($session->requestURL)) { $url = $session->requestURL; unset($session->requestURL); $this->_redirect($url); } else { $this->_helper->getHelper('FlashMessenger') ->addMessage('You have been successfully logged in as '.$session- >user); $this->_redirect('/login/success'); } } else { $this->view->message = 'You could not be logged in. Please try again.'; } } } } public function successAction() { if ($this->_helper->getHelper('FlashMessenger')->getMessages()) { $this->view->messages = $this->_helper ->getHelper('FlashMessenger') ->getMessages(); } else { $this->_redirect('/login'); } } public function logoutAction() { Zend_Auth::getInstance()->clearIdentity(); Zend_Session::destroy(); $this->_redirect('/'); } }

    Read the article

  • Zend Framework: Navigation XML and duplicate page elements

    - by jakenoble
    Hi In XML I'd normal expect the following to be perfectly valid and navigable in a meaningful way using something like PHP's DomDocument: <?xml version="1.0" encoding="UTF-8"?> <configdata> <page> <name>Home</name> </page> <page> <name>Log in</name> </page> </configdata> This is not the case when using Zend_Navigation. Each <page> element needs to have a unique name, so you would need to do: <?xml version="1.0" encoding="UTF-8"?> <configdata> <page_home> <name>Home</name> </page_home> <page_log_in> <name>Log in</name> </page_log_in> </configdata> This works, but is very annoying. I'd much rather have multiple page elements which can have the same name and can be easily copy and pasted when creating many pages for navigation. Why does each one need a unique name? Is there a way of not having to have a unique name?

    Read the article

  • Getting an Ajax response from Zend Framework Controller

    - by JavaLava
    I'm doing an Ajax request on one of my views to a Controller but I am unable to send back a response to the Ajax method. In the snippet below, I am trying to send the word 'hellopanda' back but in the alert message, I'll get data as an object. View : $.ajax({ type: "POST", url: "localhost/some-activity", data: dataString, success: function(data) { alert( "Data is: " + data); //do something with data }, error: function(data){ alert( "Data is: " + data); //do something with data }, onComplete: function(){ } }); Controller: public function someActivityAction(){ //do stuff echo "hellopanda"; } I'm pretty sure the echo is the problem. Any insights on to how to do a proper response to the view would be greatly appreciated.

    Read the article

  • Zend Framework headLink() helper and HTML5

    - by Richard Knop
    I have set doctype to HTML 5 like this: $view->doctype('HTML5'); Then I have added a stylesheet like this: $view->headLink()->appendStylesheet($view->baseUrl().'/css/reset.css'); It produces link tag like this: <link href="/css/reset.css" media="screen" rel="stylesheet" type="text/css" > But for HTML 5 this would be correct, no? <link rel="stylesheet" href="/css/reset.css"> One more question. How to produce meta tag like this with headMeta() helper? <meta charset="utf-8">

    Read the article

  • “Disk /dev/xvda1 doesn't contain a valid partition table”

    - by Simpanoz
    Iam newbie to EC2 and Ubuntu 11 (EC2 Free tier Ubuntu). I have made following commands. sudo mkfs -t ext4 /dev/xvdf6 sudo mkdir /db sudo vim /etc/fstab /dev/xvdf6 /db ext4 noatime,noexec,nodiratime 0 0 sudo mount /dev/xvdf6 /db fdisk -l I got following output. Can some one guide me what I am doing wrong and how it can be rectified. Disk /dev/xvda1: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders, total 16777216 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/xvda1 doesn't contain a valid partition table Disk /dev/xvdf6: 6442 MB, 6442450944 bytes 255 heads, 63 sectors/track, 783 cylinders, total 12582912 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/xvdf6 doesn't contain a valid partition table.

    Read the article

  • Creating Persistent Drive Labels With UDEV Using /dev/disk/by-path

    - by Matt
    I have a new BackBlaze Pod (BackBlaze Pod 2.0). It has 45 3TB drives and they when I first set it up they were labeled /dev/sda through /dev/sdz and /dev/sdaa through /dev/sdas. I used mdadm to setup three really big 15 drive RAID6 arrays. However, since first setup a few weeks ago I had a couple of the hard drives fail on me. I've replaced them but now the arrays are complaining because they can't find the missing drives. When I list the the disks... ls -l /dev/sd* I see that /dev/sda /dev/sdf /dev/sdk /dev/sdp no longer appear and now there are 4 new ones... /dev/sdau /dev/sdav /dev/sdaw /dev/sdax I also just found that I can do this... ls -l /dev/disk/by-path/ total 0 lrwxrwxrwx 1 root root 10 Sep 19 18:08 pci-0000:02:04.0-scsi-0:0:0:0 -> ../../sdau lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:02:04.0-scsi-0:1:0:0 -> ../../sdb lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:02:04.0-scsi-0:2:0:0 -> ../../sdc lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:02:04.0-scsi-0:3:0:0 -> ../../sdd lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:02:04.0-scsi-0:4:0:0 -> ../../sde lrwxrwxrwx 1 root root 10 Sep 19 18:08 pci-0000:02:04.0-scsi-2:0:0:0 -> ../../sdae lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:02:04.0-scsi-2:1:0:0 -> ../../sdg lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:02:04.0-scsi-2:2:0:0 -> ../../sdh lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:02:04.0-scsi-2:3:0:0 -> ../../sdi lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:02:04.0-scsi-2:4:0:0 -> ../../sdj lrwxrwxrwx 1 root root 10 Sep 19 18:08 pci-0000:02:04.0-scsi-3:0:0:0 -> ../../sdav lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:02:04.0-scsi-3:1:0:0 -> ../../sdl lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:02:04.0-scsi-3:2:0:0 -> ../../sdm lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:02:04.0-scsi-3:3:0:0 -> ../../sdn lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:02:04.0-scsi-3:4:0:0 -> ../../sdo lrwxrwxrwx 1 root root 10 Sep 19 18:08 pci-0000:04:04.0-scsi-0:0:0:0 -> ../../sdax lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:04:04.0-scsi-0:1:0:0 -> ../../sdq lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:04:04.0-scsi-0:2:0:0 -> ../../sdr lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:04:04.0-scsi-0:3:0:0 -> ../../sds lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:04:04.0-scsi-0:4:0:0 -> ../../sdt lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:04:04.0-scsi-2:0:0:0 -> ../../sdu lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:04:04.0-scsi-2:1:0:0 -> ../../sdv lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:04:04.0-scsi-2:2:0:0 -> ../../sdw lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:04:04.0-scsi-2:3:0:0 -> ../../sdx lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:04:04.0-scsi-2:4:0:0 -> ../../sdy lrwxrwxrwx 1 root root 9 Sep 19 18:08 pci-0000:04:04.0-scsi-3:0:0:0 -> ../../sdz I didn't list them all....you can see the problem above. They're sorted by scsi id here but sda is missing...replaced by sdau...etc... So obviously the arrays are complaining. Is it possible to get Linux to reread the drive labels in the correct order or am I screwed? My initial design with 15 drive arrays is not ideal. With 3TB drives the rebuild times were taking 3 or 4 days....maybe more. I'm scrapping the whole design and I think I am going to go with 6 x 7 RAID5 disk arrays and 3 hot spares to make the arrays a bit easier to manage and shorten the rebuild times. But I'd like to clean up the drive labels so they aren't out of order. I haven't figured out how to do this yet. Does anyone know how to get this straightened out? Thanks, Matt

    Read the article

  • Mounting both /dev/sda and /dev/sda1 - how can this be?

    - by itsadok
    I work on an Amazon EC2 instance that somebody else set up. We have an EBS volume mounted on /dev/sda, even though the root device is already on /dev/sda1, and we're also using `/dev/sda2' user@server:~$ mount /dev/sda1 on / type ext3 (rw) ... (snip) /dev/sda2 on /mnt type ext3 (rw) /dev/sda on /vol type xfs (rw,noatime) ... This doesn't seem to fit with what I know about the way /dev/ works. How is this possible, and more importantly: will this cause trouble in the future? I'm running ubuntu 9.04 jaunty.

    Read the article

  • debian dependencies (libssl-dev and libncurses5)

    - by RubyFreak
    I'm trying to install under RVM the Ruby Enterpise (REE) under debian My debian is squeeze (uname -r) 2.6.18-194.26.1.el5.028stab070.14xen i did try to install ree but it complains that it is missing libssl-dev and libreadline5-dev. I did update my lenny to squeeze, but i didn't update the kernel, since its a production server. The operational system is already updated and upgraded sources.list: deb http://ftp.de.debian.org/debian/ squeeze main contrib non-free deb-src http://ftp.de.debian.org/debian/ squeeze main contrib non-free deb http://security.debian.org/ squeeze/updates main deb-src http://security.debian.org/ squeeze/updates main I did try to install it using the following command: apt-get install libssl-dev libreadline5-dev But unfortunately i'm getting the following problems: The following packages have unmet dependencies: libreadline5-dev: Depends: libncurses5-dev but it is not going to be installed libssl-dev: Depends: libssl0.9.8 (= 0.9.8o-4squeeze1) but 0.9.8o-6 is to be installed E: Broken packages I was thinking to reinstall those packages and install again, but it has too many dependencies, and it is a production server, that i would like to know if there is any other way to fix it. Or at least to double check if it is necessary to reinstall both :-/

    Read the article

  • Proper error handling in a custom Zend_Autoloader?

    - by Pekka
    I'm building a custom autoloader based on Zend Framework's autoloading (related question here). The basic approach, taken from that question, is class My_Autoloader implements Zend_Loader_Autoloader_Interface { public function autoload($class) { // add your logic to find the required classes in here } } and then binding the new autoloader class to a class prefix. Now what I'm unsure about is how to handle errors inside the autoload method (for example, "class file not found") in a proper, ZF compliant way. I'm new to the framework, its conventions and style. Do I quietly return false and let the class creation process crash? Do I output an error or log message somehow (which would be nice to pinpoint the problem) and return false? If so, what is the Zend way of doing that? Do I trigger an error? Do I throw an exception? If so, what kind?

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >