{"id":19818507,"url":"https://github.com/bscheshirwork/hyphenation-grid","last_synced_at":"2026-05-13T18:02:25.396Z","repository":{"id":25085841,"uuid":"28506557","full_name":"bscheshirwork/hyphenation-grid","owner":"bscheshirwork","description":null,"archived":false,"fork":false,"pushed_at":"2015-02-25T09:02:53.000Z","size":184,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T08:13:38.588Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bscheshirwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-26T09:35:32.000Z","updated_at":"2015-02-25T09:02:53.000Z","dependencies_parsed_at":"2022-08-23T00:40:09.772Z","dependency_job_id":null,"html_url":"https://github.com/bscheshirwork/hyphenation-grid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bscheshirwork%2Fhyphenation-grid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bscheshirwork%2Fhyphenation-grid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bscheshirwork%2Fhyphenation-grid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bscheshirwork%2Fhyphenation-grid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bscheshirwork","download_url":"https://codeload.github.com/bscheshirwork/hyphenation-grid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241174497,"owners_count":19922326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T10:15:54.730Z","updated_at":"2025-11-22T18:03:58.855Z","avatar_url":"https://github.com/bscheshirwork.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"hyphenation-grid\n========================\n\nДанные одной сущности размещаем в несколько строк для zii.widgets.grid.CGridView\n\nИспользование:\n\nИмпортируем компонент:\n\n```php\n\u003c?php Yii::import('vendor.bscheshir.hyphenation-grid.HypGridView', true); ?\u003e\n```\n\u003cbr\u003e\u003cbr\u003e\nВ свойствах добавлены следующие настройки: \n\u003cbr\u003e\n\n'hyphenationColumns' = array();\nмассив номеров колонок, по которым осуществлять перенос на новую строку\nили \n\u003cbr\u003e\n\n'hyphenationOnCount' = null;\nчерез каждые N колонок делать перенос\n\u003cbr\u003e\n\n'hyphenationRowHtmlOptionsExpression' \nаналог rowHtmlOptionsExpression, применяется к tr перенесённой строки. Если передан hyphenationOnCount - берётся для каждого переноса. Иначе требуется передать массив, где ключами будут номера колонок, по которым идёт перенос,\nа значениями - применяемые для этого переноса опции.\n```php\n'hyphenationRowHtmlOptionsExpression'=\u003e[\n\t2=\u003e'[\"id\"=\u003e\"second_{$row}\"]', //обратите внимание на вид кавычек - строка будет передана в evaluateExpression\n],\n```\n\u003cbr\u003e\n\n'hyphenationRowCssClassExpression'\nаналог rowCssClassExpression, применяется к tr перенесённой строки. Если передан hyphenationOnCount - берётся для каждого переноса. Иначе требуется передать массив, где ключами будут номера колонок, по которым идёт перенос,\nа значениями - применяемые для этого переноса опции.\n```php\n    'hyphenationRowCssClassExpression'=\u003e[\n        2=\u003e'($row % 2)?\"hidden\":\"\"', //обратите внимание на вид кавычек - строка будет передана в evaluateExpression\n    ],\n```\n\u003cbr\u003e\n\n'hyphenationDisableRowCssClass'\nЕсли данный флаг передан - для новой строки не будет применятся стиль из перечесления rowCssClass.\nРаботает в паре с 'hyphenationRewriteClass'\nПо умолчанию true\n\u003cbr\u003e\n\n'hyphenationRewriteClass'\nПри переносе строки перезаписывать класс, сформированный для начала строки. Новые значения, вычисленные в\nhyphenationRowHtmlOptionsExpression и hyphenationRowCssClassExpression заменят $htmlOptions['class'] начала строки.\nИспользуйте с 'hyphenationDisableRowCssClass'=\u003efalse, если всё ещё хотите применить тот же стиль из перечисления rowCssClass, что и в начале строки.\nПо умолчанию false\n\u003cbr\u003e\n\nИспользуем colspan для объеденения колонок.\n\u003cbr\u003e\nВ остальном - используем как обычно. \n\u003cbr\u003e\n\nПример\n```php\n...\n$controller = $this;\n...\n\u003c?php $this-\u003ewidget('HypGridView', [\n\t'id'=\u003e'currencyrate-grid-1',\n\t'dataProvider'=\u003e$dataProvider,\n\t'hyphenationColumns'=\u003e[2,3],\n\t//'hyphenationOnCount'=\u003e2,\n\t'hyphenationRowHtmlOptionsExpression'=\u003e[\n\t\t2=\u003e'[\"id\"=\u003e\"second_{$row}\"]'\n\t],\n\t'hyphenationRowCssClassExpression'=\u003e[\n\t\t2=\u003e['display'=\u003e'none']\n\t],\n\t'hyphenationDisableRowCssClass'=\u003etrue,\n\t'hyphenationRewriteClass'=\u003efalse,\n\t'columns'=\u003e[\n\t\t'ccy',\n\t\t'ccy_name_ru',\n\t\t[\n\t\t\t'name'=\u003e'buy',\n\t\t\t'type' =\u003e 'raw',\n\t\t\t'value'=\u003e'$data-\u003ebuy/10000',\n\t\t\t'headerHtmlOptions'=\u003e['colspan'=\u003e'2'],\n\t\t\t'htmlOptions'=\u003e['colspan'=\u003e'2'],\n\t\t],\n\t\t[\n\t\t\t'name'=\u003e'sortOrder',\n\t\t\t'evaluateHtmlOptions'=\u003etrue,\n\t\t\t'htmlOptions'=\u003e['id'=\u003e'\"ordering_{$data-\u003eid}\"'],\t\t\n\t\t],\n\t\t'unit',\n\t\t'date',\n\t\t[\n\t\t\t'name'=\u003e'somename',\n\t\t\t'header'=\u003e'someheader',\n\t\t\t'value' =\u003e function($data, $row) use ($controller) {\n\t\t\t\treturn $controller-\u003erenderPartial('trait/__someone', array('data' =\u003e $data), true);\n\t\t\t},\t\t  \n\t\t],\n\t],\n]); ?\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbscheshirwork%2Fhyphenation-grid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbscheshirwork%2Fhyphenation-grid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbscheshirwork%2Fhyphenation-grid/lists"}