WebChemistry / images

Image storage for Nette Framework
36 stars 20 forks source link

Update documentation #12

Closed JanMikes closed 8 years ago

JanMikes commented 8 years ago

Info about how to change checkbox's label "Delete this image?" would be nice.

This is what i tried and didnt work for me:

$image = $form->addImageUpload("image", "image")
            ->setDefaultValue($entity->getImage());

        $checkbox = $image->getCheckbox();
        $checkbox::$labelContent = "test";

If i do this: Checkbox::$labelContent = "test"; before adding input, it works. Though what is the best place to globally change this value for all inputs, bootstrap.php?

JanMikes commented 8 years ago

Neither this is working for me:

$image->getCheckbox()->getLabelPart()->setHtml("test");
MartkCz commented 8 years ago

I think it must works:

$image->getCheckbox()->caption = "foo";

Checkbox::$labelContent is only for global use, for example in bootstrap

JanMikes commented 8 years ago

@MartkCz this works thanks. Anyways i wanted to use the global variant and as you mentioned i am using it in bootstrap.php. Though in previous versions there was possibility to to change caption globally in extensions settings, what do you think about putting it back, since i think static access to property is not so clean.

JanMikes commented 8 years ago

Awesome, thank you!