承接 plutonex/themes 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

plutonex/themes

Composer 安装命令:

composer require plutonex/themes

包简介

Theme Managing Library for Laravel 4 php framework

README 文档

README

Theme library for Laravel 4.

How to install

Add dependency to the Laravel composer.json file

"require": {
        "plutonex/themes": "1.0.*"
    }

and add Service Provider to the app/config/app.php file under array key 'providers'

'Plutonex\Themes\ThemesServiceProvider',

You are required to create a 'themes' folder under the public directory of laravel app. For example all your themes should be developed under /public/themes/

Your themes should be basic laravel views inside the themes directory within a directory with theme name. For example, if you want to create a theme called 'myTheme', the layouts of the theme should be within the path /public/themes/myTheme/layouts

Tip

You can create sub directories under your theme folder, like 'partials' to keep parts of the theme file in common and 'assets' folder to keep all your assets.

How to use inside Routes

There are many ways to use this library. The easiest way is to set the theme and layout inside a app/routes.php

	
	Route::get('/', function()
	{
		pxTheme::setTheme('myTheme');
		pxTheme::setLayout('default');

		return View::make('hello');
	});
	
	Route::group(array('prefix' => 'admin'),function()
	{
		pxTheme::setTheme('adminTheme');
		pxTheme::setLayout('default');

		Route::get('dashboard', function()
		{
			return View::make('admin.dashboard');
		}

		Route::get('users', function()
		{
			pxTheme::setLayout('list');

			return View::make('admin.dashboard');
		}

	});

You can either choose to set theme and layout as shown above or simply bind your URI pattern with theme and layout.

 // app/routes.php 

 // Theme::when({pattern},{layout},{theme});

 Theme::when('/','homePage','myTheme');
 Theme::when('/*','default','myTheme');

 Theme::when('admin','default','adminTheme');
 Theme::when('admin/*','appLayout','adminTheme');

Blade Helpers

@px.theme('themeName')

This helps you set the theme within a blade view template

@px.layout('layoutName')

This helps you set the theme layout within a blade view

@px.include('path.to.view')

This helps include a view file within the current theme directory

统计信息

  • 总下载量: 40
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 13
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 13
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: BSD
  • 更新时间: 2013-08-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固