Making Your Own Blocks

Permalink
I am creating my own block as per the given example in concrite 5 "Making Your Own Blocks"
after copying my block under /c5/blocks/mycreated block
eg(/c5/blocks/basic_test)
if i am clicking on Add functionality to add the block created by me i am geting an error
An unexpected error occurred.
BasicTestBlockController not found. Please check that the block controller file contains the correct class name.

can anybody tell me how to create a new block

1 Attachment

 
Remo replied on at Permalink Reply
Remo
In which directory does your block reside? basic_test or mycreatedblock?

the name of the controller class must much the directory name

basic_test -> BasicTestBlockController
my_created_block -> MyCreatedBlockBlockController
santosh replied on at Permalink Reply
My project name is "test1"
which is under www/ directory.
in my project "test1" i am copying my new block by name

"basic_test" ie under
www/test1/block/.
this block i have downloaded from the example which is given under "how to create a block."
and the name of the controller i have specified as BasicTestBlockController for "basic_test"

but again if i go and click on Add functionality to add the block created by me i am geting an error
"An unexpected error occurred.
BasicTestBlockController not found. Please check that the block controller file contains the correct class name."
santosh replied on at Permalink Reply
My project name is "test1"
which is under www/ directory.
in my project "test1" i am copying my new block by name

"basic_test" ie under
www/test1/block/.
this block i have downloaded from the example which is given under "how to create a block."
and the name of the controller i have specified as BasicTestBlockController for "basic_test"

but again if i go and click on Add functionality to add the block created by me i am geting an error
"An unexpected error occurred.
BasicTestBlockController not found. Please check that the block controller file contains the correct class name."
santosh replied on at Permalink Reply
My project name is "test1"
which is under www/ directory.
in my project "test1" i am copying my new block by name

"basic_test" ie under
www/test1/block/.
this block i have downloaded from the example which is given under "how to create a block."
and the name of the controller i have specified as BasicTestBlockController for "basic_test"

but again if i go and click on Add functionality to add the block created by me i am geting an error
"An unexpected error occurred.
BasicTestBlockController not found. Please check that the block controller file contains the correct class name."
santosh replied on at Permalink Reply
My project name is "test1"
which is under www/ directory.
in my project "test1" i am copying my new block by name

"basic_test" ie under
www/test1/block/.
this block i have downloaded from the example which is given under "how to create a block."
and the name of the controller i have specified as BasicTestBlockController for "basic_test"

but again if i go and click on Add functionality to add the block created by me i am geting an error
"An unexpected error occurred.
BasicTestBlockController not found. Please check that the block controller file contains the correct class name."
admin replied on at Permalink Reply
I downloaded the block in my local install and it installed fine... but I'm wondering if there is an issue regarding caching...
jizzle replied on at Permalink Reply
jizzle
I am also getting the same thing. It was working fine but I moved my site to Apache and changed directories at the same time - then started getting this error.

Maybe something with directory location?
santosh replied on at Permalink Reply
Sir,
I checked it,there is no issue regarding caching...
tapster replied on at Permalink Reply
I'm getting exactly the same problem when I try to add the basic_test block:

An unexpected error occurred.
BlockTestBlockController not found. Please check that the block controller file contains the correct class name.

Obviously the block is installed (i.e. copied) to the correct place because the Add Functionality routine is finding it. It's just not processing the controller.php correctly for some reason.

Did santosh find a solution for this?
tapster replied on at Permalink Reply
I've solved this now. The controller.php file contains just <? for the php start processing instruction. I changed this to <?php and it now works.
andrew replied on at Permalink Reply
andrew
Thanks for catching this. I've updated the basic test block in that tutorial to no longer use short tags.