Custom attribute type, package, installation
Permalink
Long time PHP developer....new to C5 Integration. Stuck on attribute inclusion into a package and feel like i'm doing something really basic...really wrong. At this point i'm just working on the framework and trying to get it to install correctly.
Concrete version 8+
The error i get on install is "Error Call to a member function getController() on null from …\src\Attribute\Category\AbstractCategory.php:236
my package controller is located at :
\packages\blog_mailer\attributes\blog_mailer_list\controller.php
\packages\blog_mailer\attributes\blog_mailer_list\form.php
My Controller:
My install routine:
Concrete version 8+
The error i get on install is "Error Call to a member function getController() on null from …\src\Attribute\Category\AbstractCategory.php:236
my package controller is located at :
\packages\blog_mailer\attributes\blog_mailer_list\controller.php
\packages\blog_mailer\attributes\blog_mailer_list\form.php
My Controller:
namespace Concrete\Package\BlogMailer\Attributes\BlogMailerList; use Concrete\Core\Attribute\FontAwesomeIconFormatter; class Controller extends \Concrete\Attribute\Number\Controller{ public function getIconFormatter(){ return new FontAwesomeIconFormatter('list-alt'); } public function form(){ } }
My install routine:
$key=new Pagekey(); $key->setAttributeKeyHandle('BlogMailerList'); $key->setAttributeKeyName('Mailing List'); $key->setIsAttributeKeySearchable(false); $key=$category->add('blog_mailer_list',$key,null,$pkg);
Something like this (haven't tried it so might need some tweaking):