本文整理汇总了PHP中View::share方法的典型用法代码示例。如果您正苦于以下问题:PHP View::share方法的具体用法?PHP View::share怎么用?PHP View::share使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View::share方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$this->userdata = $this->checkUserdata();
// apply authorization filter
$this->beforeFilter(function () {
if (!$this->userdata && Request::segment(1) !== 'login') {
return Redirect::to('/login');
}
});
// templates for app errors
App::missing(function ($exception) {
return Response::view('errors.404_cms', array(), 404);
});
App::error(function (Exception $exception, $code) {
Log::error($exception);
if ($code == 403) {
return Response::view('/errors/error_403', array(), 403);
}
});
// shared assets
Orchestra\Asset::add("bootstrap-css", "assets/css/bootstrap.min.css");
Orchestra\Asset::add("bootstrap-theme", "assets/css/bootstrap-theme.min.css");
Orchestra\Asset::add("font-awesome", "assets/css/font-awesome.min.css");
Orchestra\Asset::add("cms-css", "assets/css/cms.css");
Orchestra\Asset::add("jquery", "assets/js/jquery.js");
Orchestra\Asset::add("bootstrap-js", "assets/js/bootstrap.min.js");
Orchestra\Asset::add("handlers-js", "assets/js/handlers.js");
// shared views
View::share("active_menu_id", 1);
View::share("userdata", $this->userdata);
// configuration
Config::set("view.pagination", "common/pagination");
}
示例2: setupLayout
/**
* Setup the layout used by the controller.
*
* @return void
*/
protected function setupLayout()
{
if (!is_null($this->layout)) {
$this->layout = View::make($this->layout);
}
View::share('currentUser', Auth::user());
}
示例3: getIndex
public function getIndex($location = '')
{
$loading_arr = Config::get('loading');
$loading = $loading_arr[array_rand($loading_arr)];
View::share('location', $location);
$this->layout->content = View::make('index', compact('loading'));
}
示例4: __construct
public function __construct()
{
$this->locales = Config::get('app.locales');
$this->module = array('name' => self::$name, 'group' => self::$group, 'rest' => self::$group, 'tpl' => static::returnTpl('admin/dicvals'), 'gtpl' => static::returnTpl(), 'entity' => self::$entity, 'entity_name' => self::$entity_name);
View::share('module', $this->module);
View::share('CLASS', __CLASS__);
}
示例5: index
function index()
{
View::share('big_title', 'Edit Content Template');
// $getdata = $this->html->get_id($ids);
// // $view['arr_action'] = ['#'=>'Choose An Action','/blast/template/draf'=>'Save As Draft','/blast/template/receiver'=>'Send Blast'];
// // $view['action'] = "";
if (Input::has('id')) {
$id = Input::get('id');
$getjson = $this->html->get_id($id);
} else {
$getjson = $this->html->get_last();
}
$jsonform = json_decode($getjson->form);
$view['template'] = $this->html->get_all();
$view['json'] = $getjson->form;
// $view['form'] = $this->cform;
foreach ($jsonform as $key => $value) {
$view['html'][] = $this->cform->generate($key, $value->element, $value->label, Session::get($key));
$view['label'][] = $value->label;
}
$view['mail_name'] = Session::get('mail_name');
// $view['header'] = Session::get('header');
// $view['content'] = Session::get('content');
$view['twitter'] = Session::get('twitter');
$view['email'] = Session::get('email');
$view['facebook'] = Session::get('facebook');
$view['linkedin'] = Session::get('linkedin');
$view['notip'] = Session::get('notip');
$this->layout->content = View::make('blast_email/index', $view);
}
示例6: doMeta
public function doMeta()
{
$error = false;
// Set our metadata
Metadata::set(Input::except(['user', 'pass', '_token']));
Metadata::set('theme', 'default');
// Check the Stripe API key is valid
try {
Stripe::setApiKey(Metadata::item('stripe_key'));
Stripe\Balance::retrieve();
} catch (Exception $e) {
$error = 'That Stripe key doesn’t look valid!';
}
// Create the user
if (User::whereEmail(Input::get('user'))->exists()) {
// We're installing, can't have users already (I think)
// $error = 'Somebody’s already signed up with that email address!';
} else {
User::create(['username' => 'admin', 'name' => 'Administrator', 'level' => User::level('admin'), 'email' => Input::get('user'), 'password' => Input::get('pass')]);
}
if ($error === false) {
return Redirect::to('install/done');
}
View::share('error', $error);
return self::showMeta();
}
示例7: __construct
/**
* __construct
*
* @return void
*/
public function __construct()
{
parent::__construct();
API::$component = 'admin';
$this->url = Config::get('layla.admin.url_prefix') . '/';
View::share('base_url', URL::base());
}
示例8: showUpdate
/**
* add/update agency
* @param integer $id
*/
function showUpdate($id = 0)
{
$this->data['id'] = $id;
View::share('jsTag', HTML::script("{$this->assetURL}js/select.js"));
// get list Category
$categoryModel = new CategoryBaseModel();
$this->data['listCategory'] = $categoryModel->getAllForm(0, 0, 'Run of Network');
// get list Flight Objective
$this->data['listFlightObjective'] = Config::get('data.flight_objective');
$this->loadLeftMenu('menu.flightList');
// WHEN UPDATE SHOW CURRENT INFOMATION
if ($id != 0) {
$this->loadLeftMenu('menu.flightUpdate');
$item = $this->model->with('category', 'campaign', 'publisher', 'publisherSite', 'publisher_ad_zone')->find($id);
if ($item) {
$this->data['item'] = $item;
} else {
return Redirect::to($this->moduleURL . 'show-list');
}
}
if (Request::isMethod('post')) {
if ($this->postUpdate($id, $this->data)) {
return $this->redirectAfterSave(Input::get('save'));
}
}
$this->layout->content = View::make('showUpdate', $this->data);
}
示例9: __construct
public function __construct()
{
$this->currentUser = \Auth::user();
\View::share('currentUser', $this->currentUser);
$this->routesNamespace = config('authcluster.login_name_space') . '.';
$this->viewsNamespace = config('authcluster.views_name_space') . '::';
}
示例10: __construct
/**
* Initializer.
*
* @access public
* @return BaseController
*/
public function __construct()
{
$is_admin = Request::is('admin*');
$is_backend = Request::is('backend*');
/* Set middleware(s) based on route URLs */
if ($is_admin || $is_backend) {
$this->middleware('auth');
if ($is_backend) {
// Backend specific middleware
$this->middleware('auth.backend');
}
$this->middleware('auth.permissions');
if (!Request::is('*users/change-password')) {
// No validation for stale password if password is being changed
$this->middleware('auth.pw_6_months');
}
}
list($this->link_type, $this->link, $this->layout, $this->current_theme) = current_section();
View::share('link_type', $this->link_type);
View::share('current_theme', $this->current_theme);
$website_settings = Setting::lists('value', 'name')->all();
View::share('website_settings', $website_settings);
$locale = Setting::value('language');
App::setLocale($locale);
Lang::setLocale($locale);
$this->user = current_user();
View::share('current_user', $this->user);
View::share('current_user_companies', current_user_companies());
}
示例11: returnRoutes
public static function returnRoutes($prefix = null)
{
$dics_for_cache = ['projects', 'types'];
foreach ($dics_for_cache as $dic_name) {
## Refresh dics cache
#Cache::forget('dic_' . $dic_name);
$dic_[$dic_name] = Cache::get('dic_' . $dic_name);
if (!$dic_[$dic_name]) {
Cache::forget('dic_' . $dic_name);
$dic_[$dic_name] = Dic::valuesBySlug($dic_name, function ($query) {
$query->orderBy('lft', 'ASC');
}, ['allfields', 'alltextfields'], true, true, true);
#Helper::d($dic_name); Helper::ta($dic_{$dic_name}); #die;
$dic_[$dic_name] = DicLib::loadImages($dic_[$dic_name], ['avatar', 'image', 'logo', 'photo', 'header_img']);
#Helper::d($dic_name); Helper::ta($dic_{$dic_name}); #die;
Cache::add('dic_' . $dic_name, $dic_[$dic_name], self::$global_cache_min);
}
View::share('dic_' . $dic_name, $dic_[$dic_name]);
#Helper::d($dic_name); Helper::ta($dic_{$dic_name});
}
#Helper::tad($dic_{'city'});
#die;
Route::group(array('prefix' => '{lang}'), function () {
Route::any('/project/{slug}', array('as' => 'app.project', 'uses' => __CLASS__ . '@appProject'));
#Route::any('/ajax/send-message', array('as' => 'ajax.send-message', 'uses' => __CLASS__.'@postSendMessage'));
#Route::any('/ajax/some-action', array('as' => 'ajax.some-action', 'uses' => __CLASS__.'@postSomeAction'));
});
Route::group(array(), function () {
#Route::any('/ajax/send-message', array('as' => 'ajax.send-message', 'uses' => __CLASS__.'@postSendMessage'));
#Route::any('/ajax/some-action', array('as' => 'ajax.some-action', 'uses' => __CLASS__.'@postSomeAction'));
});
}
示例12: setupLayout
/**
* Setup the layout used by the controller.
*
* @return void
*/
protected function setupLayout()
{
View::share("h4ss2_groups", Sentry::findAllGroups());
if (!is_null($this->layout)) {
$this->layout = View::make($this->layout);
}
}
示例13: error
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function error()
{
$list_language = AppLanguage::all();
dd($list_language);
View::share('list_language', $list_language);
return view('errors.404');
}
示例14: __construct
public function __construct()
{
View::share('active', '');
View::share('account', Session::get('account'));
View::share('character_name', Session::get('character_name', ''));
View::share('server', Session::get('server', ''));
}
示例15: getEdit
public function getEdit($custom_field_id)
{
$customfield = CustomField::find($custom_field_id);
View::share('campoextra', $customfield);
View::share('fieldtypes', $this->customFieldsMangaer->getTypes());
$this->layout->content = View::make('backend.camposextra.layout')->nest('content', 'backend.camposextra.form');
}