本文整理汇总了PHP中Thin\Inflector::isSha1方法的典型用法代码示例。如果您正苦于以下问题:PHP Inflector::isSha1方法的具体用法?PHP Inflector::isSha1怎么用?PHP Inflector::isSha1使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Thin\Inflector
的用法示例。
在下文中一共展示了Inflector::isSha1方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
namespace Thin;
use CrudBundle\Crud as c;
return array('singular' => 'Utilisateur', 'plural' => 'Utilisateurs', 'default_order' => 'name', 'default_order_direction' => 'ASC', 'items_by_page' => 25, 'display' => 'firstname,name', 'many' => array(), 'before_create' => function () {
$_POST['password'] = sha1($_POST['password']);
}, 'after_create' => null, 'before_read' => null, 'after_read' => null, 'before_update' => function () {
$_POST['password'] = !Inflector::isSha1($_POST['password']) ? sha1($_POST['password']) : $_POST['password'];
}, 'after_update' => null, 'before_delete' => null, 'after_delete' => null, 'fields' => array('username' => array('label' => 'Identifiant'), 'name' => array('label' => 'Nom'), 'firstname' => array('label' => 'Prénom'), 'password' => array('label' => 'Mot de passe', 'is_listable' => false, 'is_exportable' => false, 'is_searchable' => false, 'is_sortable' => false, 'form_type' => 'password'), 'skype' => array('is_listable' => false, 'required' => false), 'partner_id' => array('label' => 'Partenaire', 'content_view' => function ($row) {
return c::row($row, 'partner', 'name');
}, 'content_list' => function ($row) {
return c::row($row, 'partner', 'name', false);
}, 'content_search' => function ($idField) {
return c::rows($idField, 'partner', 'name', 'name');
}, 'content_create' => function ($row, $required) {
return c::rowsForm('partner_id', 'partner', 'name', 'name', $row->partner_id, $required);
}), 'gender' => array('is_listable' => false, 'label' => 'Civilité', 'content_view' => function ($row) {
return c::vocabulary($row['gender'], 'Monsieur, Madame, Mademoiselle');
}, 'content_list' => function ($row) {
return c::vocabulary($row['gender'], 'Monsieur, Madame, Mademoiselle');
}, 'content_search' => function ($idField) {
return c::vocabularies($idField, 'Monsieur, Madame, Mademoiselle');
}, 'content_create' => function ($row, $required) {
return c::vocabulariesForm('gender', 'Monsieur, Madame, Mademoiselle', $row->gender, $required);
}), 'tel_work' => array('label' => 'Tel'), 'tel_home' => array('label' => 'Tel Dom.', 'is_listable' => false), 'tel_cellular' => array('label' => 'Tel Mob.', 'is_listable' => false), 'twitter' => array('is_listable' => false), 'linkedin' => array('is_listable' => false)));
示例2: edituserAction
public function edituserAction()
{
$userDb = jdb(Config::get('bundle.auth.database', 'auth'), Config::get('bundle.auth.table.user', 'user'));
$id = request()->getId();
$this->view->title = 'Mettre à jour un utlisateur';
if (!is_null($id) && auth()->is('admin')) {
$old = $userDb->find($id);
$this->view->row = $old->assoc();
if (true === $this->isPost()) {
$_POST['password'] = !Inflector::isSha1($_POST['password']) ? sha1($_POST['password']) : $_POST['password'];
$old->hydrate()->save();
$this->forward('userlist');
}
} else {
$this->forward('home');
}
}