The $this statements need to sit inside a function - probably beforeFilter in 
your case.

On 23 Aug 2014, at 03:03, 'Dallas' via CakePHP <[email protected]> 
wrote:

> I have migrated from  cakephp 1.2.5 to Cake 2.5.3 by installing new cake, 
> importing old database and importing files.  I have made changes to file as 
> per the migration guides but I am getting this error:Error: syntax error, 
> unexpected '$this' (T_VARIABLE), expecting function (T_FUNCTION)      
> File: 
> /home/dallasrosie/public_html/musicthatjumpedtheshark.com/app/Controller/GroupsController.php
>    
> Line: 43
> here is line 43 of GroupsController.php:
>   // Pass through the request and response objects 
> // AND declare the visibility of the method
> public function __construct($request = null, $response = null)
> {
>     parent::__construct($request, $response);
> }
>         $this->Layout = 'home';
>         $this->PageTitle = 'Music That Jumped the Shark ~ groups';
>         
>         // get the random ad links
>         include('includes/ad_selection.php');
>         $this->set('top_ads', $_ads_top_link);
>         $this->set('side_ads', $_ads_side_link);
>         $this->top_ad_links = $_ads_top_link;
>         $this->side_ad_links = $_ads_side_link;
>     }
>     
>     // DEBUG
>     public function under_construction()
>     {
>         $this->layout = 'temp';
>         
>     }
> I am getting this message on all pages like this: 
> musicthatjumpedtheshark.com/groups   ..../genres ...
> 
> and on the blogs/   page I get this error?
> Error: Call to a member function parseAccept() on a non-object        
> File: 
> /home/dallasrosie/public_html/musicthatjumpedtheshark.com/lib/Cake/Controller/Component/RequestHandlerComponent.php
>      
> Line: 157
> here is line 157:
>    if (!$resp->is_valid)
>             {
>                 # set the error code so that we can display it
>                 $comment_errors['captcha'] = '<span class="error">incorrect 
> response</span>';
>                 $ret = false;
>             }
>         }
>         
>         // validate comment
>         if($data['comment'] == '')
>         {
>             $comment_errors['comment'] = '<span class="error">comment may not 
> be empty</span>';
>             $ret = false;
>         }
> 
> Please help.  I don't know if I should be using some kind of shell to upgrade 
> - I don't know how to use them yet.  Any suggestions are GREATLY appreciated.
> Thank you.
> 
> 
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Reply via email to