如何为CakePHP 4中的Bootstrap-UI 3设置默认对齐方式?
这是关于CakePHP的Boostrap-UI插件的一个特别晦涩的问题,但我希望有人可以提供帮助。
我正在使用bootstrap-ui( https://github.com/friendsofcake/bootstrap-bootstrap-ui )版本3.0,因此使用Bootstrap 4.6。
我正在尝试创建一个具有控制的控件的表单,该表格与他们的标签保持在此处的示例 -
我看不到如何定义默认列分发即,标签和控制容器的类是col-4
和col-8
,而没有任何断点。
如果我尝试类似的事情 -
'align' => [
'left' => 4,
'middle' => 8,
]
创建的类是col-md-4
和col-md-8
ie,似乎默认为MD作为列的断点。
我知道这有点晦涩,但是有人知道如何做我想做的事吗?
This is a particularly obscure question about the Boostrap-UI plugin for CakePHP but I'm hoping someone might be able to help.
I’m using Bootstrap-UI (https://github.com/FriendsOfCake/bootstrap-ui) version 3.0, so using Bootstrap 4.6.
I’m trying to create a form that has controls that are aligned horizontally with their labels using the example from the readme here -
This works fine except I can’t see how to define the default column distribution ie so that the classes for the label and the control container are something like col-4
and col-8
without any breakpoint defined.
If I try something like -
'align' => [
'left' => 4,
'middle' => 8,
]
The classes created are col-md-4
and col-md-8
ie it seems to default to md as the breakpoint for the columns.
I know this is a bit obscure but does anyone have any idea how to do what I want?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当前不支持的AFAICT,这意味着您只能生成默认的
MB
断点或自己指定断点。您可以在GitHub上打开问题,以获取功能请求。作为解决方法,您可以扩展插件的形式助手和覆盖
formHelper :: _ gridclass()
以修改生成的类列表,这符合此内容的线条,这将从生成的类字符串中删除默认的断点:另请参见 https://book.cake.cake.org.org.org.org.org /4/en/views/helpers.html#creating-helpers
AFAICT that's currently not supported, meaning you can only generate the default
mb
breakpoint ones, or specify breakpoints yourself.You can open an issue over at GitHub for a feature request. As a workaround you could extend the plugin'S form helper and overwrite
FormHelper::_gridClass()
to modify the generated classlist, something along the lines of this, which would remove the default breakpoint from the generated class string:See also https://book.cakephp.org/4/en/views/helpers.html#creating-helpers