{"action":"created","issue":{"url":"https://api.github.com/repos/bzick/fenom/issues/129","labels_url":"https://api.github.com/repos/bzick/fenom/issues/129/labels{/name}","comments_url":"https://api.github.com/repos/bzick/fenom/issues/129/comments","events_url":"https://api.github.com/repos/bzick/fenom/issues/129/events","html_url":"https://github.com/bzick/fenom/issues/129","id":53406822,"number":129,"title":"Функция for и совместимость со smarty","user":{"login":"f0mich","id":10266499,"avatar_url":"https://avatars.githubusercontent.com/u/10266499?v=3","gravatar_id":"","url":"https://api.github.com/users/f0mich","html_url":"https://github.com/f0mich","followers_url":"https://api.github.com/users/f0mich/followers","following_url":"https://api.github.com/users/f0mich/following{/other_user}","gists_url":"https://api.github.com/users/f0mich/gists{/gist_id}","starred_url":"https://api.github.com/users/f0mich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f0mich/subscriptions","organizations_url":"https://api.github.com/users/f0mich/orgs","repos_url":"https://api.github.com/users/f0mich/repos","events_url":"https://api.github.com/users/f0mich/events{/privacy}","received_events_url":"https://api.github.com/users/f0mich/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-05T15:25:40Z","updated_at":"2015-01-05T16:03:30Z","closed_at":null,"body":"Пытаюсь перейти со смарти, наткнулся на проблему не полной совместимости со смарти.\r\nнапример синтаксис for в smarty \r\n{for $i=0 to 3}\r\n{/for}\r\nчто приводит к фечному циклу в феноме т.к. феном хочет to=3\r\nимхо можно прийти к полной совемстимости и это не потребует особых дополнительный затрат.\r\nс токинайзерами разбираться лень, но, например, если в файл Compiler.php в функцию forOpen\r\nпосле \r\n```php\r\n        $p   = $scope->tpl->parseParams($tokens, $p);\r\n```\r\nдобавить\r\n```php\r\n\t\t$k = array_keys($p);\r\n\t\t$kc = count($k);\r\n\t\tfor($i=0; $i<$kc; $i++)\r\n\t\t\tif (!is_numeric($k[$i]) and $p[$k[$i]]===\"true\" and isset($k[$i+1]) and is_numeric($k[$i+1]))\r\n\t\t\t{\r\n\t\t\t\t$p[$k[$i]] = $p[$k[$i+1]];\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n```\r\nто будет совместимый со смарти синтаксис."},"comment":{"url":"https://api.github.com/repos/bzick/fenom/issues/comments/68728797","html_url":"https://github.com/bzick/fenom/issues/129#issuecomment-68728797","issue_url":"https://api.github.com/repos/bzick/fenom/issues/129","id":68728797,"user":{"login":"bzick","id":345384,"avatar_url":"https://avatars.githubusercontent.com/u/345384?v=3","gravatar_id":"","url":"https://api.github.com/users/bzick","html_url":"https://github.com/bzick","followers_url":"https://api.github.com/users/bzick/followers","following_url":"https://api.github.com/users/bzick/following{/other_user}","gists_url":"https://api.github.com/users/bzick/gists{/gist_id}","starred_url":"https://api.github.com/users/bzick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bzick/subscriptions","organizations_url":"https://api.github.com/users/bzick/orgs","repos_url":"https://api.github.com/users/bzick/repos","events_url":"https://api.github.com/users/bzick/events{/privacy}","received_events_url":"https://api.github.com/users/bzick/received_events","type":"User","site_admin":false},"created_at":"2015-01-05T16:03:29Z","updated_at":"2015-01-05T16:03:29Z","body":"Это похоже на ошибку. Так не должно быть, шаг по умолчанию 1. Я гляну что не так"}}