Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure the path to the block dir #164

Open
boehsermoe opened this issue Nov 23, 2018 · 3 comments
Open

Ensure the path to the block dir #164

boehsermoe opened this issue Nov 23, 2018 · 3 comments
Assignees

Comments

@boehsermoe
Copy link
Member

In #156 we needed the base path of a block and solved it temporary with reflection class.

Here we need a better solution for it and could solved it with a getBaseBlockPath function which can used for getPreviewImageSource and bootstrap blocks.

@boehsermoe boehsermoe changed the title Ensure the path to the block Ensure the path to the block dir Nov 23, 2018
@nadar
Copy link
Member

nadar commented Feb 27, 2019

@boehsermoe I am just checking all issues, and for now i am not sure what the problem is here? What we have to do? Can you make an example? Thanks.

@boehsermoe
Copy link
Member Author

In getPreviewImageSource the base path of the block will be generate with reflection class. In the bootstrap blocks it is solve with a relative path.

We need a general base function for the blocks to resolve the base path of it.
Something like this, but maybe a solution without reflection?

function getBasePath()
{
        $reflector = new \ReflectionClass($this);
        $dirPath = dirname($reflector->getFileName(), 2);

        return $dirPath;
}

@nadar
Copy link
Member

nadar commented Mar 1, 2019

so we could maybe also use it for getViewPaht()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants