Controller.php It is correct ?

Permalink
It is correct?
<?php    
defined('C5_EXECUTE') or die(_("Access Denied."));
class NameThemePackage extends Package {
   protected $pkgHandle = 'name_theme';
   protected $appVersionRequired = '5.1';
   protected $pkgVersion = '1.0';
   public function getPackageDescription() {
      return t("description");
   }
   public function getPackageName() {
      return t("Name Theme");
   }
   public function install() {
      $pkg = parent::install();
      PageTheme::add('name_theme', $pkg);

Fxxxx
 
Mainio replied on at Permalink Reply
Mainio
Are you confirming it to be ok as a controller code or are you experiencing some problems with it?

Looks ok for me with a quick look. If you're experiencing troubles, would need to know what for finding out the solution.


Antti / Mainio
Fxxxx replied on at Permalink Reply
Fxxxx
Dreamweaver say that there are some problems...
Mainio replied on at Permalink Best Answer Reply
Mainio
Oh, okay. I just ran a syntax check on it and here's your problem.

For each of your if-clauses add 1 more closing bracket. So this:
if(!is_object(CollectionType::getByHandle('home')) {


becomes this:
if(!is_object(CollectionType::getByHandle('home'))) {



Antti