SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Dec 2002
    Location
    Philadelphia
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    _forward not working in my flavor of Zend

    First of all, PLEASE forgive my Zend newbie-ness. I've been doing the killerphp.com Zend tutorials and I've been some cool stuff but when adding my own ideas, I'm running into a problem with using the _forward command.

    I get how _forward is SUPPOSED to work..... call forward and designate the action you're looking for and the specified controller. But it simply won't work for me, and NO, I'm NOT trying to call _forward in the init( )

    Here is my folder structure:
    http://www.mediabreeze.com/zendFolders.jpg

    S
    o this is the class that's being called:


    PHP Code:
    class VidRequestController extends Zend_Controller_Action {   
     
    /*     * runs every time     *      */   

     
    public function init()    {                    }   

     public function 
    indexAction()    {                        
    $this->view->instructions "Please upload a video </br>";                                
     
    $form = new Zend_Form();                
    $form->setMethod('post');
                    
    $id $form->createElement('hidden','id'); 
                   
    $videostring $form->createElement('select','videostring');   
             
    // get string to video path            
        
    $videostring ->setLabel('Videos:')                          
    ->
    addMultiOptions(array(
                    
    'swing1' => 'swing1',                'swing2' => 'swing2',                'swing3' => 'swing3',                'swing4' => 'swing4'
                    
    ));                               
    $register $form->createElement('submit','register');                
    $register->setLabel("Convert Video")                        
    ->
    setIgnore(true);
                    
    $form->addElements(array(                   
     
    $videostring,    $id,  $register                ));  
                                
      
    $form->setAction("/videoprocess/");                           
     
    $this->view->formRender $form;                                                
     }    

           public function 
    videoDoneAction()    {         
     
    $this->view->instructions "Video Done. </br>";        
     }    

    And this is the class doing the calling :

    PHP Code:
     class VideoProcessController extends Zend_Controller_Action {    /*     * runs every time     *      */    
    public function init()   
     {

        }   
     public function 
    indexAction()    {               
     
    $this->view->viewText "This page receives the video<br />";                               
     
    //this returns the whole array              
     // $data = $this->_request->getParams();                               
      //this returns just one element of the array                
     
    $vid $this->_request->getParam('videostring');                                                   
    $this->view->passedVideo "<br /><br />Passed video: <i>".$vid."</i>";                   
     
    $command  ="C:/xampp/htdocs/mobilePPC/videos/ffmpeg -i  C:/xampp/htdocs/mobilePPC/videos/".$vid.".avi -ab 32  C:/xampp/htdocs/mobilePPC/videos/".$vid.".wmv" ;
                       
    $output exec($command,$output,$return);                                      
    $result =($return==0) ? "success" "failure";                                    
      if(
    $this->_request->isPost() ){                       
     
    $data = array(                          
      
    "wuci"=> "000-000-000",                           
     
    "lessonname"=> "mobileLesson1",                          
      
    "coachname"=> "coach name string",                           
     
    "videopath"=> $vid,
                            );                   }                                               
     
    $lesson = new Lesson();               
     
    $lesson->insert($data);              
                             
     
    $this->_forward('videoDone','VidRequest');  
                  
       
    $this->view->return "<br /><br />return: ".$result." ";           
                                                                     }                             
        } 
    And this is the error I'm getting:
    exception 'Zend_Controller_Action_Exception' with message 'Action "videodone" does not exist and was not trapped in __call()' in C:\xampp\php\ZendFramework\library\Zend\Controller\Action.php:485 Stack trace: #0 C:\xampp\php\ZendFramework\library\Zend\Controller\Action.php(518): Zend_Controller_Action->__call('videodoneAction', Array) #1 C:\xampp\php\ZendFramework\library\Zend\Controller\Dispatcher\Standard.php(295): Zend_Controller_Action->dispatch('videodoneAction') #2 C:\xampp\php\ZendFramework\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #3 C:\xampp\htdocs\mobilePPC\html\index.php(54): Zend_Controller_Front->dispatch() #4 {main}

    Sorry, I wish I were able to post online but I can't seem to get the environment working on my server so working in localhost only for now.
    Also, I apologize for the code formatting issue, got messed up when I tried to post it here in the forum.

  2. #2
    SitePoint Addict
    Join Date
    Dec 2002
    Location
    Philadelphia
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone ? anyone?
    ...................... Beuller ?

  3. #3
    SitePoint Addict
    Join Date
    Dec 2002
    Location
    Philadelphia
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I figured it out btw..... for whatever reason, in my installation of Zend, if you use a controller name that is camelCase with two capitals like MyNewController instead of MynewController , when you try to access a view conjunct with a _forward call , it inserts a dash in there, so it looks for My-New folder in the views section.... weird. So I renamed all my controllers to be lowercase only and it all works now.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •