Finallly i solved my own problem... but i don't know what exactly it is...
Drupal follow strictly their names theme and if i get wrong in something small the block crashes.. but i'll show you how it is working now the code.
blocktest.module
/**
* Implements hook_theme() to add the template definition.
**/
function blocktest_theme($existing, $type, $theme, $path) {
return array(
'block-test' => array(
'variables' => array('test_var' => NULL),
),
);
}
Plugin/Block/BlocktestController.php
namespace Drupal\blocktest\Plugin\Block;
use Drupal\Core\Block\BlockBase;
/**
* @Block(
* id = "block_test",
* admin_label = @Translation("Block Test"),
* )
*/
class BlocktestController extends BlockBase
{
/**
* Builds and returns the renderable array for this block plugin.
*
* If a block should not be rendered because it has no content, then this
* method must also ensure to return no content: it must then only return an
* empty array, or an empty array with #cache set (with cacheability metadata
* indicating the circumstances for it being empty).
*
* @return array
* A renderable array representing the content of the block.
*
* @see \Drupal\block\BlockViewBuilder
*/
public function build()
{
return array(
'#theme' => 'block-test',
'#test_var' => $this->t('Test Value'),
);
}
}
block-test.html.twig
<p> This is the lotus template with a value of {{ test_var }} </p>
<button>it works</button>
Thanks!