Jump to content

[SOLVED] class missing in modules function __construct()


ai_99

Recommended Posts

Hi,

please tell me what i do wrong.

 

I try to write new module, and when i try to install it, i have error:

 

blockheadercontacts (parse error in /modules/blockheadercontacts/blockheadercontacts.php)blockheadercontacts (class missing in /modules/blockheadercontacts/blockheadercontacts.php)

 

I try to delete all code, and this construction work fine:

 

<?php

 

if (!defined('_PS_VERSION_'))

exit;

 

class BlockHeaderContacts extends Module

{

 

}

?>

 

But when i try to add public function __construct() i have error

blockheadercontacts (parse error in /modules/blockheadercontacts/blockheadercontacts.php)blockheadercontacts (class missing in /modules/blockheadercontacts/blockheadercontacts.php)

again.

 

 

<?php

 

if (!defined('_PS_VERSION_'))

exit;

 

class BlockHeaderContacts extends Module

{

public function __construct()

{

$this->name = 'blockheadercontacts'

$this->tab = 'front_office_features';

$this->author = 'Developer Name';

$this->version = 1.0;

$this->need_instance = 0;

 

parent::__construct();

 

$this->displayName = $this->l('Shop contacts info block');

$this->description = $this->l('Adds a block that displays information about the shop contacts to header');

}

 

}

?>

 

What is wrong in this code?

Edited by ai_99 (see edit history)
Link to comment
Share on other sites

thanks for respnse.

 

; missing in this post :(

i solved problem - i'm copied working module from my shop, rename it, copied all my code to new module. after that module installs correct (no changes in my code). Maybe it's a cms bug. I still don't know wy (i try create new module and have same problem with install it).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...