Skip to content
Permalink
Browse files
Theming addition.
  • Loading branch information
nipurndoshi committed Sep 10, 2015
1 parent dfc41b6 commit 46104a4129cbbaca097e6c4afced1695412836df
Show file tree
Hide file tree
Showing 4 changed files with 203 additions and 1 deletion.
@@ -123,6 +123,7 @@
'Illuminate\Workbench\WorkbenchServiceProvider',
'Wsis\WsisServiceProvider',
'Airavata\AiravataServiceProvider',
'Teepluss\Theme\ThemeServiceProvider',
),

/*
@@ -191,6 +192,7 @@
'View' => 'Illuminate\Support\Facades\View',
'WSIS' => 'Wsis\Facades\Wsis',
'Airavata' => 'Airavata\Facades\Airavata',
'Theme' => 'Teepluss\Theme\Facades\Theme',
),

);
@@ -0,0 +1,143 @@
<?php

return array(

/*
|--------------------------------------------------------------------------
| Asset url path
|--------------------------------------------------------------------------
|
| The path to asset, this config can be cdn host.
| eg. http://cdn.domain.com
|
*/

'assetUrl' => URL::to('/'),

/*
|--------------------------------------------------------------------------
| Asset compression path
|--------------------------------------------------------------------------
|
| The path to compress assets after at public directory.
|
*/

'compressDir' => 'cache',

/*
|--------------------------------------------------------------------------
| Force compress assets
|--------------------------------------------------------------------------
|
| This forces Theme to (re)compile compression assets on every invocation.
| By default this is FALSE. This is handy for development and debugging,
| It should never be used in a production environment.
|
*/

'forceCompress' => false,

/*
|--------------------------------------------------------------------------
| Capture asset compression
|--------------------------------------------------------------------------
|
| When you queue asset to be compression, normally It read your file(s)
| everytime, but on production you can stop the process by set capture
| true, this will be increase performance.
|
| eg. (App::environment() == 'production') ? true : false
|
*/

'assetCapture' => false,

/*
|--------------------------------------------------------------------------
| Theme Default
|--------------------------------------------------------------------------
|
| If you don't set a theme when using a "Theme" class the default theme
| will replace automatically.
|
*/

'themeDefault' => 'default',

/*
|--------------------------------------------------------------------------
| Layout Default
|--------------------------------------------------------------------------
|
| If you don't set a layout when using a "Theme" class the default layout
| will replace automatically.
|
*/

'layoutDefault' => 'default',

/*
|--------------------------------------------------------------------------
| Path to lookup theme
|--------------------------------------------------------------------------
|
| The root path contains themes collections.
|
*/

'themeDir' => 'themes',

/*
|--------------------------------------------------------------------------
| A pieces of theme collections
|--------------------------------------------------------------------------
|
| Inside a theme path we need to set up directories to
| keep "layouts", "assets" and "partials".
|
*/

'containerDir' => array(
'layout' => 'layouts',
'asset' => 'assets',
'partial' => 'partials',
'widget' => 'widgets',
'view' => 'views'
),

/*
|--------------------------------------------------------------------------
| Listener from events
|--------------------------------------------------------------------------
|
| You can hook a theme when event fired on activities
| this is cool feature to set up a title, meta, default styles and scripts.
|
*/

'events' => array(

// Before all event, this event will effect for global.
'before' => function($theme)
{
//$theme->setTitle('Something in global.');
},

// This event will fire as a global you can add any assets you want here.
'asset' => function($asset)
{
// Preparing asset you need to serve after.
$asset->cook('backbone', function($asset)
{
$asset->add('backbone', '//cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min.js');
$asset->add('underscorejs', '//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js');
});

// To use cook 'backbone' you can fire with 'serve' method.
// Theme::asset()->serve('backbone');
}

)

);
@@ -0,0 +1,56 @@
<?php

return array(

/*
|--------------------------------------------------------------------------
| PHP alow in twig
|--------------------------------------------------------------------------
|
| This is laravel alias to allow in twig compiler
| The list all of methods is at /app/config/app.php
|
*/

'allows' => array(
'Auth',
'Cache',
'Config',
'Cookie',
'Form',
'HTML',
'Input',
'Lang',
'Paginator',
'Str',
'Theme',
'URL',
'Validator'
),

/*
|--------------------------------------------------------------------------
| PHP alow in twig
|--------------------------------------------------------------------------
|
| This is laravel alias to allow in twig compiler
| The list all of methods is at /app/config/app.php
|
*/

'hooks' => function($twig)
{
// Example add funciton name "demo".
/*$function = new Twig_SimpleFunction('example', function()
{
$args = func_get_args();
return "Example" . print_r($args, true);
});
$twig->addFunction($function);*/

return $twig;
}

);
@@ -4,7 +4,8 @@
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"laravel/framework": "4.2.*"
"laravel/framework": "4.2.*",
"teepluss/theme": "1.*@dev"
},
"autoload": {
"classmap": [

0 comments on commit 46104a4

Please sign in to comment.