{"action":"created","issue":{"url":"https://api.github.com/repos/Talesoft/tale-jade/issues/20","labels_url":"https://api.github.com/repos/Talesoft/tale-jade/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/Talesoft/tale-jade/issues/20/comments","events_url":"https://api.github.com/repos/Talesoft/tale-jade/issues/20/events","html_url":"https://github.com/Talesoft/tale-jade/issues/20","id":115490729,"number":20,"title":"Buffered code blocks","user":{"login":"jacmoe","id":85424,"avatar_url":"https://avatars.githubusercontent.com/u/85424?v=3","gravatar_id":"","url":"https://api.github.com/users/jacmoe","html_url":"https://github.com/jacmoe","followers_url":"https://api.github.com/users/jacmoe/followers","following_url":"https://api.github.com/users/jacmoe/following{/other_user}","gists_url":"https://api.github.com/users/jacmoe/gists{/gist_id}","starred_url":"https://api.github.com/users/jacmoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacmoe/subscriptions","organizations_url":"https://api.github.com/users/jacmoe/orgs","repos_url":"https://api.github.com/users/jacmoe/repos","events_url":"https://api.github.com/users/jacmoe/events{/privacy}","received_events_url":"https://api.github.com/users/jacmoe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-06T11:44:47Z","updated_at":"2015-11-06T12:13:17Z","closed_at":null,"body":"It would be incredible useful to have support for buffered code blocks, because PHP code is so messy. :)\r\n\r\nI have to resort to this hack when dealing with a buffered object:\r\n~~~jade\r\n  -\r\n    $columns = ['id','tracker_id', 'project_id', 'subject',\r\n    'description:ntext', 'issue_category_id', 'user_id', ['class' => 'yii\\\\grid\\\\ActionColumn',\r\n     'contentOptions' => ['nowrap'=>'nowrap'] ] ]\r\n\r\n  !=GridView::widget(['dataProvider'=> $dataProvider,'filterModel'=> $searchModel,'columns'=> $columns])\r\n~~~"},"comment":{"url":"https://api.github.com/repos/Talesoft/tale-jade/issues/comments/154395032","html_url":"https://github.com/Talesoft/tale-jade/issues/20#issuecomment-154395032","issue_url":"https://api.github.com/repos/Talesoft/tale-jade/issues/20","id":154395032,"user":{"login":"TorbenKoehn","id":1403556,"avatar_url":"https://avatars.githubusercontent.com/u/1403556?v=3","gravatar_id":"","url":"https://api.github.com/users/TorbenKoehn","html_url":"https://github.com/TorbenKoehn","followers_url":"https://api.github.com/users/TorbenKoehn/followers","following_url":"https://api.github.com/users/TorbenKoehn/following{/other_user}","gists_url":"https://api.github.com/users/TorbenKoehn/gists{/gist_id}","starred_url":"https://api.github.com/users/TorbenKoehn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TorbenKoehn/subscriptions","organizations_url":"https://api.github.com/users/TorbenKoehn/orgs","repos_url":"https://api.github.com/users/TorbenKoehn/repos","events_url":"https://api.github.com/users/TorbenKoehn/events{/privacy}","received_events_url":"https://api.github.com/users/TorbenKoehn/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T12:13:17Z","updated_at":"2015-11-06T12:13:17Z","body":"The `include`-construct there actually doesn't compile to `include('...')`, it takes the content of the included file and puts it into proper PHP tags, so you don't need the `includes/some-php` file anymore after compiling once.\r\n\r\nAssuming `includes/some-php.php` contains\r\n```php\r\n<?php\r\n\r\n$columns = ['id','tracker_id', 'project_id', 'subject',\r\n    'description:ntext', 'issue_category_id', 'user_id', ['class' => 'yii\\\\grid\\\\ActionColumn',\r\n     'contentOptions' => ['nowrap'=>'nowrap'] ] ];\r\n```\r\n\r\nTale Jade will compile that to\r\n```php\r\n<?php $columns = ['id','tracker_id', 'project_id', 'subject',\r\n    'description:ntext', 'issue_category_id', 'user_id', ['class' => 'yii\\\\grid\\\\ActionColumn',\r\n     'contentOptions' => ['nowrap'=>'nowrap'] ] ];\r\n?>\r\n```\r\ndirectly, not to `include('includes/some-php.php')`\r\n\r\n\r\n\r\nWith that amount of options you'd get into trouble in almost any template language I guess.\r\n\r\nAnother possibility would be passing that stuff to the renderer, from PHP\r\n```jade\r\n$renderer->render('jade-file', ['columns' => ['id', 'tracker_id', ...]]);\r\n```\r\n\r\nand using it directly inside the template then (`$columns` will be available this way).\r\n\r\nThat way you could also provide configuration outside of templates (e.g. client can select which columns to display)\r\n\r\nAnother thing I could think of would be that maybe we can shorten the style of \"defining an associative array\" a bit, maybe something like this:\r\n\r\n```jade\r\n$options(class='yii\\grid\\ActionColumn', contentOptions=['nowrap' => 'nowrap'])\r\n$columns('id', 'tracker_id', 'project_id', 'subject', ..., $options)\r\n```\r\n\r\nThis would be Tale Jade exclusive, but we could actually implement something like this, $ isn't used anywhere in Node.js jade.\r\n\r\n"}}