当前位置: 首页>>代码示例>>PHP>>正文


PHP FormItem::password方法代码示例

本文整理汇总了PHP中FormItem::password方法的典型用法代码示例。如果您正苦于以下问题:PHP FormItem::password方法的具体用法?PHP FormItem::password怎么用?PHP FormItem::password使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FormItem的用法示例。


在下文中一共展示了FormItem::password方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

<?php

Admin::model('Cartalyst\\Sentinel\\Users\\EloquentUser')->title('Юзеры')->display(function () {
    $display = AdminDisplay::datatables();
    $display->with();
    $display->filters([]);
    $display->columns([Column::string('id')->label('Id'), Column::string('email')->label('Email'), Column::string('first_name')->label('Имя')]);
    return $display;
})->create(function () {
    $form = AdminForm::form();
    $form->items([FormItem::columns()->columns([[FormItem::text('email', 'Email'), FormItem::password('password', 'Пароль'), FormItem::password('password_confirm', 'Подтверждение пароля')], [FormItem::text('first_name', 'Имя'), FormItem::text('last_name', 'Фамилия'), FormItem::view('admin.user_create')]])]);
    return $form;
})->edit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::columns()->columns([[FormItem::text('email', 'Email'), FormItem::password('password', 'Пароль'), FormItem::password('password_confirm', 'Подтверждение пароля')], [FormItem::text('first_name', 'Имя'), FormItem::text('last_name', 'Фамилия'), FormItem::view('admin.user_update')]])]);
    return $form;
});
开发者ID:AngryGantz,项目名称:lv-test5,代码行数:17,代码来源:EloquentUser.php

示例2: count

        return $user_roles->count() > 0 ? $tooltip . $hidden_roles : '';
    }), Column::custom()->label('Custom Permissions')->callback(function ($instance) {
        return count($instance->permissions) > 0 ? 'Yes' : 'No';
    })]);
    return $display;
})->createAndEdit(function ($id) {
    $form = AdminForm::tabbed();
    /**
     * Fix
     */
    if (is_null($id)) {
        $form->storable(false);
        $form->event_handler('SleepingOwl\\Admin\\Events\\UserEvent');
        $password = FormItem::password('password', 'Password')->sentinel()->required();
    } else {
        $password = FormItem::password('password', 'Password')->sentinel();
    }
    $form->items(['Details' => [FormItem::text('first_name', 'Firstname')->required(), FormItem::text('last_name', 'Lastname')->required(), FormItem::text('email', 'Email')->required()->unique(), FormItem::sentinelpassword('password', 'Password'), FormItem::image('avatar', 'Avatar')], 'Roles & Permissions' => [FormItem::roles('roles', 'Roles')->model('Cartalyst\\Sentinel\\Roles\\EloquentRole')->display('name'), FormItem::permissions('permissions', 'Permissions')->inherited()], 'User Settings' => [FormItem::custom()->display(function ($instance) {
        $skins = ['blue' => 'Blue', 'blue-light' => 'Blue Light', 'black' => 'Black', 'black-light' => 'Black Light', 'purple' => 'Purple', 'purple-light' => 'Purple Light', 'green' => 'Green', 'green-light' => 'Green Light', 'red' => 'Red', 'red-light' => 'Red Light', 'yellow' => 'Yellow', 'yellow-light' => 'Yellow Light'];
        $field_params = ['name' => 'theme.skin', 'lang' => null, 'label_size' => null, 'field_size' => null, 'label' => 'Theme Skin', 'required_field' => false, 'multi' => false, 'plugin' => null, 'nullable' => false, 'options' => $skins, 'value' => \SoaUserSetting::get('theme.skin', config('admintheme.skin'), $instance->id), 'help_text' => null];
        return view(AdminTemplate::view('formitem.select'), $field_params)->render();
    })->callback(function ($instance) {
        \SoaUserSetting::set('theme.skin', \Request::input('theme_skin'), $instance->id);
        \SoaUserSetting::save();
    }), FormItem::custom()->display(function ($instance) {
        $field_params = ['name' => 'theme.fixed_layout', 'lang' => null, 'label_size' => null, 'field_size' => null, 'label' => 'Fixed Layout', 'required_field' => false, 'value' => \SoaUserSetting::get('theme.fixed_layout', config('admintheme.fixed_layout'), $instance->id), 'help_text' => 'You can\'t use fixed and boxed layouts together.'];
        return view(AdminTemplate::view('formitem.checkbox'), $field_params)->render();
    })->callback(function ($instance) {
        if (!\Request::has('theme_fixed_layout')) {
            \Request::merge(['theme_fixed_layout' => false]);
        } else {
开发者ID:larabox,项目名称:larabox,代码行数:31,代码来源:User.php

示例3: function

        case 'name':
            return function () {
                InlineEditItem::text('name', NULL)->validationRule('required|regex:/^[a-zA-Z0-9_@]{3,20}$/');
            };
            break;
        default:
            return function () {
            };
            break;
    }
})->form(function () {
    // Describing elements in create and editing forms
    FormItem::text('username', 'Login')->validationRule('required|regex:/^[a-zA-Z0-9_@]{3,20}$/');
    FormItem::text('name', 'Name')->validationRule('required|regex:/^[a-zA-Z0-9_\\s@]{3,20}$/');
    $data = Input::all();
    if (preg_match('/edit$/', Request::url()) || isset($data['_method']) && $data['_method'] == 'PUT') {
        // ok this is update statement, so let's rock
        FormItem::checkbox('changePassword', 'Change Password');
        if (isset($data['changePassword']) && $data['changePassword'] == 1) {
            FormItem::text('passwd', 'Password')->validationRule('required|regex:/^[a-zA-Z0-9_@]{6,20}$/');
            FormItem::text('passwdConfirm', 'Password Confirmation')->validationRule('required|same:passwd');
        } else {
            FormItem::password('passwd', 'Password');
            FormItem::password('passwdConfirm', 'Password Confirmation');
        }
    } else {
        // this is create statement
        FormItem::password('passwd', 'Password')->validationRule('required|regex:/^[a-zA-Z0-9_@]{6,20}$/');
        FormItem::password('passwdConfirm', 'Password Confirmation')->validationRule('required|same:passwd');
    }
});
开发者ID:procoders,项目名称:printrock,代码行数:31,代码来源:Administrator.php

示例4: config

use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Input;
use App\Product;
use App\UserProduct;
Admin::model('App\\User')->title('Пользователи')->display(function () {
    $display = AdminDisplay::datatables();
    $display->columns([Column::checkbox(), Column::string('id')->label('ID'), Column::string('name')->label('Имя'), Column::custom()->label('Актив.')->callback(function ($instance) {
        return $instance->is_active ? '&check;' : '-';
    }), Column::string('email')->label('Email'), Column::count('products')->label('Товаров')->orderable(true), Column::count('list_active_products')->label('Акт. товаров')->orderable(true), Column::string('balance')->label('Баланс')]);
    $display->columnFilters([null, ColumnFilter::select()->model('App\\User')->display('name'), null, null, null, null]);
    $display->actions([Column::action('export')->value('Раздать товары')->icon('fa-share')->callback(function ($collection) {
        $max_products_per_user = config('main.max_products_per_user', 3);
        foreach ($collection as $key => $user) {
            $active_products = $user->list_active_products;
            $count_active_products = count($active_products);
            if ($count_active_products >= 0 && $count_active_products < $max_products_per_user) {
                $random_product = Product::orderByRaw("RAND()")->first();
                try {
                    $user_product = UserProduct::create(['user_id' => $user->id, 'product_id' => $random_product->id]);
                } catch (QueryException $e) {
                    //Nothing
                }
            }
        }
    })]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::text('name', 'Name')->required(), FormItem::text('email', 'Email')->required()->unique(), FormItem::password('password', 'Пароль'), FormItem::checkbox('is_active', 'Активность')]);
    return $form;
});
开发者ID:Eduard90,项目名称:Laravel-5-Example,代码行数:31,代码来源:User.php

示例5:

<?php

/*
 * This is a simple example of the main features.
 * For full list see documentation.
 */
// Create admin model from User class with title and url alias
Admin::model(\App\User::class)->title('Users')->as('users-alias-name')->denyCreating(function () {
    // Deny creating on thursday
    //return date('w') == 4;
})->denyEditingAndDeleting(function ($instance) {
    // deny editing and deleting rows when this is true
    return $instance->email == 'admin';
})->columns(function () {
    // Describing columns for table view
    Column::string('name', 'Name');
    Column::string('email', 'Email');
})->form(function () {
    // Describing elements in create and editing forms
    FormItem::text('name', 'Name');
    FormItem::text('email', 'Email');
    FormItem::password('password', 'Password');
});
开发者ID:ateszki,项目名称:caesoweb,代码行数:23,代码来源:User.php

示例6:

<?php

Admin::model(App\User::class)->title('Usuarios')->with()->filters(function () {
})->columns(function () {
    Column::string('id', 'Id');
    Column::string('name', 'Name');
    Column::string('email', 'Email');
    Column::string('razsoc', 'Razsoc');
    Column::string('lista', 'Lista');
})->form(function () {
    FormItem::text('name', 'Name');
    FormItem::text('email', 'Email');
    FormItem::password('password', 'Password (dejar vacía para no modificar)');
    FormItem::text('razsoc', 'Razsoc');
    FormItem::CustomLista();
    FormItem::CustomRememberToken();
});
开发者ID:ateszki,项目名称:nh,代码行数:17,代码来源:User.php


注:本文中的FormItem::password方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。