本文整理汇总了PHP中trans函数的典型用法代码示例。如果您正苦于以下问题:PHP trans函数的具体用法?PHP trans怎么用?PHP trans使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了trans函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: update
public function update(User $user, UserRequest $request)
{
$user->update($request->all());
$user->roles()->sync($request->input('roleList'));
Flash::success(trans('general.updated_msg'));
return redirect(route('admin.users'));
}
开发者ID:AlexYaroma,项目名称:mightyducks,代码行数:7,代码来源:UsersController.php
示例2: translatableLabel
/**
* Return the translatable label.
*
* @param string $size
* @return null|string
*/
protected function translatableLabel($size = 'sm')
{
if ($this->object->isTranslatable()) {
return '<span class="label label-info label-' . $size . '">' . trans('streams::assignment.translatable.name') . '</span>';
}
return null;
}
开发者ID:jacksun101,项目名称:streams-platform,代码行数:13,代码来源:AssignmentPresenter.php
示例3: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
{
if (Auth::user()->id == 1) {
return $next($request);
}
return redirect()->guest('login')->withErrors(trans('auth.admin'));
}
开发者ID:timpressive,项目名称:art-auction,代码行数:15,代码来源:Administrator.php
示例4: editCustomRecord
public function editCustomRecord($parameters)
{
$parameters['outgoingSecures'] = [(object) ['id' => '', 'name' => trans('pulsar::pulsar.no_security')], (object) ['id' => 'ssl', 'name' => 'SSL'], (object) ['id' => 'tls', 'name' => 'TLS'], (object) ['id' => 'sslv2', 'name' => 'SSLv2'], (object) ['id' => 'sslv3', 'name' => 'SSLv3']];
$parameters['incomingTypes'] = [(object) ['id' => 'imap', 'name' => 'IMAP']];
$parameters['incomingSecures'] = [(object) ['id' => '', 'name' => trans('pulsar::pulsar.no_security')], (object) ['id' => 'ssl', 'name' => 'SSL']];
return $parameters;
}
开发者ID:syscover,项目名称:pulsar,代码行数:7,代码来源:EmailAccountController.php
示例5: getUser
/**
* @return User
* @throws ReflinkException
*/
public function getUser()
{
if (is_null($user = User::where('email', $this->email)->first())) {
throw new ReflinkException(trans(Password::INVALID_USER));
}
return $user;
}
开发者ID:KodiComponents,项目名称:module-users,代码行数:11,代码来源:ForgotPasswordGenerator.php
示例6: sendConfirmationEmail
/**
* Sends the event's confirmation email to the advisor.
*
* @var $event App\Event
*/
public function sendConfirmationEmail()
{
Mail::raw($this->confirmationMessage(), function ($message) {
$message->subject(trans('confirmation.subject', ['event' => $this->event->name]));
$message->to($this->email);
});
}
开发者ID:Hipp04,项目名称:registered-solutions,代码行数:12,代码来源:Advisor.php
示例7: archive
public function archive($publicId)
{
$branch = Branch::scope($publicId)->firstOrFail();
$branch->delete();
Session::flash('message', trans('texts.archived_branch'));
return Redirect::to('company/branches');
}
开发者ID:Vrian7ipx,项目名称:cascadadev,代码行数:7,代码来源:BranchController.php
示例8: update
public function update($id, Request $request)
{
$this->validate($request, $this->rules);
$product = $this->productRepo->update($id, $request->all());
session()->flash('message', trans('messages.update_success'));
return redirect()->back();
}
开发者ID:emejiasc85,项目名称:proyecto_seminario_privado,代码行数:7,代码来源:ProductsController.php
示例9: storeNode
/**
* store nestable node
*
* @param $class
* @param string|null $path
* @param integer|null $id
* @throws StoreException
* @return array
*/
protected function storeNode($class, $path = null, $id = null)
{
DB::beginTransaction();
try {
$datas = $this->request->parent != 0 || $this->request->related != 0 ? $this->getDefineDatas($class) : $this->request->all();
$this->model = $class::create($datas);
$this->model->setNode($class, $this->request);
// eğer başka ilişki varsa onları da ekle
if ($this->opsRelation && !$this->fillModel($this->opsRelation)) {
throw new StoreException($this->request->all());
}
event(new $this->events['success']($this->model));
DB::commit();
if (is_null($path)) {
$attribute = "{$this->name}_uc_first";
return response()->json(['id' => $this->model->id, 'name' => $this->model->{$attribute}]);
}
Flash::success(trans('laravel-modules-base::admin.flash.store_success'));
return $this->redirectRoute($path);
} catch (StoreException $e) {
DB::rollback();
event(new $this->events['fail']($e->getDatas()));
if (is_null($path)) {
return response()->json($this->returnData('error'));
}
Flash::error(trans('laravel-modules-base::admin.flash.store_error'));
return $this->redirectRoute($path);
}
}
开发者ID:erenmustafaozdal,项目名称:laravel-modules-base,代码行数:38,代码来源:OperationNodeTrait.php
示例10: extendWith
/**
* @param Menu $menu
*
* @return Menu
*/
public function extendWith(Menu $menu)
{
$menu->group(trans('core::sidebar.content'), function (Group $group) {
$group->item('Staff', function (Item $item) {
$item->icon('fa fa-copy');
$item->weight(10);
$item->authorize();
$item->item(trans('staff::departments.title.departments'), function (Item $item) {
$item->icon('fa fa-copy');
$item->weight(0);
$item->append('admin.staff.department.create');
$item->route('admin.staff.department.index');
$item->authorize($this->auth->hasAccess('staff.departments.index'));
});
$item->item(trans('staff::employees.title.employees'), function (Item $item) {
$item->icon('fa fa-copy');
$item->weight(0);
$item->append('admin.staff.employee.create');
$item->route('admin.staff.employee.index');
$item->authorize($this->auth->hasAccess('staff.employees.index'));
});
// append
});
});
return $menu;
}
开发者ID:seanjermey,项目名称:bwm.dev,代码行数:31,代码来源:SidebarExtender.php
示例11: buildupScript
/**
* Build tree grid scripts.
*
* @return void
*/
protected function buildupScript()
{
$confirm = trans('admin::lang.delete_confirm');
$token = csrf_token();
$this->script = <<<SCRIPT
\$('#{$this->elementId}').nestable({});
\$('._delete').click(function() {
var id = \$(this).data('id');
if(confirm("{$confirm}")) {
\$.post('/{$this->path}/' + id, {_method:'delete','_token':'{$token}'}, function(data){
\$.pjax.reload('#pjax-container');
});
}
});
\$('.{$this->elementId}-save').click(function () {
var serialize = \$('#{$this->elementId}').nestable('serialize');
\$.get('/{$this->path}', {'_tree':JSON.stringify(serialize)}, function(data){
\$.pjax.reload('#pjax-container');
});
});
\$('.{$this->elementId}-refresh').click(function () {
\$.pjax.reload('#pjax-container');
});
SCRIPT;
}
开发者ID:z-song,项目名称:laravel-admin,代码行数:36,代码来源:Tree.php
示例12: translated
/**
* Return the translated country name.
*
* @param null $locale
*
* @return null|string
*/
public function translated($locale = null)
{
if (!($key = $this->object->getValue())) {
return;
}
return trans('websemantics.field_type.country::country.' . $key, [], $locale);
}
开发者ID:websemantics,项目名称:social-field_type,代码行数:14,代码来源:SocialFieldTypePresenter.php
示例13: nestedModelDisplayName
/**
* @return string Nested model display name.
*/
protected function nestedModelDisplayName()
{
if (!($nestedModelClassName = $this->nestedModelClassName())) {
return null;
}
return trans('restify.display_name.' . $nestedModelClassName);
}
开发者ID:chico-rei,项目名称:restify,代码行数:10,代码来源:BaseCommand.php
示例14: getDeleteButtonAttribute
/**
* @return string
*/
public function getDeleteButtonAttribute()
{
if (access()->allow('delete-orders')) {
return '<a href="' . route('admin.order.destroy', $this->id) . '" data-method="delete" class="btn btn-xs btn-danger"><i class="fa fa-trash" data-toggle="tooltip" data-placement="top" title="' . trans('buttons.general.crud.delete') . '">' . trans('buttons.general.crud.delete') . '</i></a>';
}
return '';
}
开发者ID:abcn,项目名称:excel,代码行数:10,代码来源:OrderAttribute.php
示例15: processForm
protected function processForm($mode, $category_id, $id = null)
{
$input = array_filter(Input::all());
$rules = ['category_id' => 'required', 'title' => 'required|unique:categories', 'user_id' => 'required'];
if ($this->user_id == Input::get('user_id')) {
if ($id) {
$subcategory = Subcategories::find($id);
$messages = $this->validateCategory($input, $rules);
if ($messages->isEmpty()) {
$subcategory = $subcategory->update($input);
}
} else {
$messages = $this->validateCategory($input, $rules);
if ($messages->isEmpty()) {
$subcategory = $this->create($input);
$subcategory = Subcategory::create($input);
}
}
if ($messages->isEmpty()) {
return Redirect()->to('user/download/subcategories')->withSuccess(trans('validation.success'));
}
return Redirect()->back()->withInput()->withErrors($messages);
} else {
return Redirect()->back()->withInput()->withErrors(trans('validation.userid-problem'));
}
}
开发者ID:majid-n,项目名称:laravel,代码行数:26,代码来源:PostsController.php
示例16: destroy
public function destroy($id)
{
$user = $this->model->findOrFail($id);
$this->userRepository->deleteUser($user);
flash()->success(trans('LaravelAdmin::laravel-admin.userDeleted'));
return Redirect::back();
}
开发者ID:shinichi81,项目名称:laravel-admin,代码行数:7,代码来源:UsersController.php
示例17: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('nickname')->unique();
$table->string('email')->unique();
$table->string('password', 60);
$table->string('pic_url')->nullable();
$table->string('language')->default('en');
$table->string('mobile_phone')->nullable();
$table->string('work_phone')->nullable();
$table->string('website')->nullable();
$table->string('twitter')->nullable();
$table->string('facebook')->nullable();
$table->string('description')->nullable();
$table->string('time_zone')->nullable();
$table->integer('rate_val')->nullable();
$table->integer('rate_count')->nullable();
$table->enum('role', array_keys(trans('globals.roles')))->default('person');
$table->enum('type', array_keys(trans('globals.type_user')))->default('normal');
$table->enum('verified', array_keys(trans('globals.verification')))->default('no');
$table->json('preferences')->nullable();
$table->rememberToken();
$table->timestamps();
$table->timestamp('disabled_at')->nullable();
$table->softDeletes();
});
}
开发者ID:ant-vel,项目名称:antVel,代码行数:33,代码来源:2014_10_12_000000_create_users_table.php
示例18: fire
/**
* Execute the console command.
*
* @param ExtensionManager $manager
* @param ExtensionCollection $extensions
*/
public function fire(ExtensionManager $manager, ExtensionCollection $extensions)
{
/* @var Extension $extension */
$extension = $extensions->get($this->argument('extension'));
$manager->install($extension, $this->option('seed'));
$this->info(trans($extension->getName()) . ' installed successfully!');
}
开发者ID:jacksun101,项目名称:streams-platform,代码行数:13,代码来源:Install.php
示例19: day_localize
function day_localize($day, $is = "en", $localize = "tr")
{
$localize = \App::getLocale();
$days['locale']['D'] = [trans('whole::http/helpers.monday'), trans('whole::http/helpers.tuesday'), trans('whole::http/helpers.wednesday'), trans('whole::http/helpers.thursday'), trans('whole::http/helpers.friday'), trans('whole::http/helpers.saturday'), trans('whole::http/helpers.sunday')];
$days['en']['D'] = ['Monday ', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
return $days['locale']['D'][array_search($day, $days[$is]['D'])];
}
开发者ID:phpspider,项目名称:core,代码行数:7,代码来源:helpers.php
示例20: fire
/**
* Performs the event.
*/
public function fire()
{
$this->info(trans('slackin.updating_status'));
$status = $this->slack->refreshUsersStatus();
$this->infoStatusUser($status);
$this->info(trans('slackin.command_done'));
}
开发者ID:vluzrmos,项目名称:lumen-slackin,代码行数:10,代码来源:SlackStatusCommand.php
注:本文中的trans函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论