Module Generator Problem

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
OmarDoleymi
New Member
New Member
Posts: 9
Joined: Mon Oct 28, 2013 11:35 am

Module Generator Problem

Post by OmarDoleymi »

Hi I am using Module Generator to create a module, lets name it "Carousel", when I tried to access the Carousel in the Content tab

it gave me the following error:
Parse error: syntax error, unexpected T_FUNCTION in /home/content/80/9944080/html/modules/CGExtensions/lib/class.cge_array.php on line 171

This is the code that i extracted from the file above

and the problem according to the parse error is in the line:

$func = function($a,$b) use ($key,$is_string,$casecompare)

I can't seem to figure what's wrong

Code: Select all

 /**
   * Sort array of hashes by key
   **/
  static public function hashsort(&$input,$key,$is_string = false,$casecompare = false)
  {
    $func = function($a,$b) use ($key,$is_string,$casecompare) {
      if( $is_string ) {
	if( $casecompare ) {
	  return strcasecmp($a[$key],$b[$key]);
	}
	else {
	  return strcmp($a[$key],$b[$key]);
	}
      }
      if( $a[$key] == $b[$key] ) return 0;
      if( $a[$key] < $b[$key] ) return -1;
      return 1;
    };
can someone advice me on that matter please?
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Module Generator Problem

Post by Rolf »

Do you have PHP 5.3+ at your webserver?
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
OmarDoleymi
New Member
New Member
Posts: 9
Joined: Mon Oct 28, 2013 11:35 am

Re: Module Generator Problem

Post by OmarDoleymi »

Nope It appears that I have 5.2.17 according to CMSMS - System Info
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Module Generator Problem

Post by Rolf »

Cmsms works on 5.2.4+, but the modules from Calguy1000 require PHP 5.3+
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
OmarDoleymi
New Member
New Member
Posts: 9
Joined: Mon Oct 28, 2013 11:35 am

Re: Module Generator Problem

Post by OmarDoleymi »

cool thanks for the help ... I went on and updated to php5.3 when you asked me that question :D

Problem Solved :D

thanks buddy I owe you one :)
Post Reply

Return to “Modules/Add-Ons”