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

php 파일에 라이믹스 내부 자료구조에 직접 접근하는 문제 #16

Open
wookho opened this issue Aug 14, 2021 · 0 comments

Comments

@wookho
Copy link

wookho commented Aug 14, 2021

https://xetown.com/questions/1569477#comment_1569588

저도 기술적으로 깊숙히는 모르나 일단 현재의 방식은 가급적 사용하지 않기를 권장하고 있고 현재 시점에서는 정상적으로 접근할 수 있는 함수들이 만들어진 상황이라 알려드립니다.

https://github.com/calvinsnax/rx-flextagram/blob/main/layouts/rx-flextagram/_config.php#L126-L136

이부분에 사용된 코드를 정식으로 만들어진 함수를 이용한 저의 코드는..

    if ($config['color_scheme'] !== 'auto') {
        $colorScheme = $config['color_scheme'];
        if ($config['color_scheme'] === 'light') {
			if(in_array('color_scheme_dark', Context::getBodyClassList())) Context::removeBodyClass('color_scheme_dark');
        } elseif ($config['color_scheme'] === 'dark') {
			if(in_array('color_scheme_light', Context::getBodyClassList())) Context::removeBodyClass('color_scheme_light');
        }
        Context::addBodyClass('color_scheme_' . $config['color_scheme']);
    }

이렇게 고쳐서 사용하고 있습니다. 추후에 변경하실 경우 참조가 될까해서 이슈로 등록해 드립니다.

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

No branches or pull requests

1 participant