{"action":"created","issue":{"url":"https://api.github.com/repos/themosis/theme/issues/2","labels_url":"https://api.github.com/repos/themosis/theme/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/themosis/theme/issues/2/comments","events_url":"https://api.github.com/repos/themosis/theme/issues/2/events","html_url":"https://github.com/themosis/theme/issues/2","id":60891170,"number":2,"title":"Option to disable routing ?","user":{"login":"tlartaud","id":494234,"avatar_url":"https://avatars.githubusercontent.com/u/494234?v=3","gravatar_id":"","url":"https://api.github.com/users/tlartaud","html_url":"https://github.com/tlartaud","followers_url":"https://api.github.com/users/tlartaud/followers","following_url":"https://api.github.com/users/tlartaud/following{/other_user}","gists_url":"https://api.github.com/users/tlartaud/gists{/gist_id}","starred_url":"https://api.github.com/users/tlartaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlartaud/subscriptions","organizations_url":"https://api.github.com/users/tlartaud/orgs","repos_url":"https://api.github.com/users/tlartaud/repos","events_url":"https://api.github.com/users/tlartaud/events{/privacy}","received_events_url":"https://api.github.com/users/tlartaud/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-12T20:12:08Z","updated_at":"2015-03-12T20:31:30Z","closed_at":null,"body":"Hi there,\r\n\r\nWe took a look theses past days to your framework and this theme. There are some really great things there, awesome folder structure like laravel, lots of helpers in your framework, and more. We would really like to use thoses functionnalities, but as we are premium theme developpers, we are looking for a solution that doesn't break the default wordpress routing, to maximize the compatibility with plugins when distributing the themes. We would also like to keep the basic child-themes functionnalities working, so a user can create for example a file archive-mytag.php that would override the main theme template.\r\n\r\nWell, is there an way to disable the routing feature of your framework, and keep the WP structure for templates files like 404.php, archive.php, search.php, etc ..?\r\n\r\nOr maybe we could think about an automated routing for all standards wp conditonals checks to work as below : \r\nif `is_<test>()` return `true`, route to `<test>Controller@index`\r\nthen the controller could check if the corresponding default wp file exist in `get_stylesheet_directory_uri() . '/app/views/wp-default-templates'`, and then load it.\r\n\r\nThe goal is to use the laravel controllers/models/views(blade) structure, without needing to re-create the whole wp routing, to help us develop premium themes that we can redistribute, and grant them compatibles with most of the wp features or plugins.\r\n\r\nWhat do you think ?\r\nThanks."},"comment":{"url":"https://api.github.com/repos/themosis/theme/issues/comments/78603202","html_url":"https://github.com/themosis/theme/issues/2#issuecomment-78603202","issue_url":"https://api.github.com/repos/themosis/theme/issues/2","id":78603202,"user":{"login":"jlambe","id":1917490,"avatar_url":"https://avatars.githubusercontent.com/u/1917490?v=3","gravatar_id":"","url":"https://api.github.com/users/jlambe","html_url":"https://github.com/jlambe","followers_url":"https://api.github.com/users/jlambe/followers","following_url":"https://api.github.com/users/jlambe/following{/other_user}","gists_url":"https://api.github.com/users/jlambe/gists{/gist_id}","starred_url":"https://api.github.com/users/jlambe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlambe/subscriptions","organizations_url":"https://api.github.com/users/jlambe/orgs","repos_url":"https://api.github.com/users/jlambe/repos","events_url":"https://api.github.com/users/jlambe/events{/privacy}","received_events_url":"https://api.github.com/users/jlambe/received_events","type":"User","site_admin":false},"created_at":"2015-03-12T20:31:30Z","updated_at":"2015-03-12T20:31:30Z","body":"Salut Thomas,\r\n\r\nyou can check this issue for child themes for still keeping the theme structure: https://github.com/themosis/themosis/issues/39\r\n\r\nAs for using the default WordPress template system, well you can simply remove the call to the `themosis_start_app()` inside the index.php file of your theme. Then create template files as usual, for example a `page.php` and set this line of code inside:\r\n\r\n```php\r\n$v = View::make('pages.about')->with($data);\r\necho($v->render());\r\n```\r\nSet your views inside the usual `views` folder or as the above link explained, you can define your own folder of views using a filter.\r\n\r\nAlso, if you would like to check for `GET` or `POST` requests on the `page.php` template, you can still use the route class like so:\r\n\r\n```php\r\n// In page.php\r\n// GET requests\r\n$r = Route::get('page', function(){\r\n    return View::make('pages.about')->with('some-data');\r\n});\r\n\r\necho($r->run());\r\n\r\n// POST requests\r\n$r = Route::post('page', function(){\r\n    return 'Page POST request';\r\n});\r\n\r\necho($r->run());\r\n```\r\nUsing the route class inside a template will allow you to use controllers on your project.\r\n\r\nHope this helps.\r\n\r\nP.S: Quel fournisseur de thème premium?"}}