本文整理汇总了PHP中Crypto::word方法的典型用法代码示例。如果您正苦于以下问题:PHP Crypto::word方法的具体用法?PHP Crypto::word怎么用?PHP Crypto::word使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Crypto
的用法示例。
在下文中一共展示了Crypto::word方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setSchema
/**
* Configura o schema do model corrente
*
* @return void
*/
public function setSchema()
{
$esquema = Cache::read('Esquema.' . $this->name);
if (!isset($esquema) || empty($esquema)) {
$meuEsquema = isset($this->esquema) ? $this->esquema : array();
$this->esquema = array();
$this->schema();
foreach ($this->_schema as $_field => $_arrProp) {
$this->esquema[$_field] = isset($meuEsquema[$_field]) ? $meuEsquema[$_field] : array();
$this->esquema[$_field]['alias'] = isset($meuEsquema[$_field]['alias']) ? $meuEsquema[$_field]['alias'] : Crypto::word($_field);
$this->esquema[$_field]['type'] = isset($meuEsquema[$_field]['type']) ? $meuEsquema[$_field]['type'] : $_arrProp['type'];
if (isset($_arrProp['key'])) {
$this->esquema[$_field]['key'] = $_arrProp['key'];
}
if (isset($_arrProp['key'])) {
$this->esquema[$_field]['sort'] = true;
}
$input = isset($meuEsquema[$_field]['input']) ? $meuEsquema[$_field]['input'] : array();
$input['label'] = isset($meuEsquema[$_field]['input']['label']) ? $meuEsquema[$_field]['input']['label'] : ucfirst(Inflector::camelize($_field));
$input['type'] = isset($meuEsquema[$_field]['input']['type']) ? $meuEsquema[$_field]['input']['type'] : 'text';
$input['div'] = isset($meuEsquema[$_field]['input']['div']) ? $meuEsquema[$_field]['input']['div'] : 'div' . Crypto::word(Inflector::camelize($this->name . '_' . $_field)) . ' div' . Crypto::word(Inflector::camelize($_field));
if (isset($_arrProp['default'])) {
$input['default'] = $_arrProp['default'];
}
if (isset($_arrProp['null']) && $_arrProp['null'] === false) {
$input['required'] = 'required';
}
if (isset($_arrProp['length'])) {
$input['maxlength'] = $_arrProp['length'];
}
if (in_array($_field, array('criado', 'modificado'))) {
unset($input['required']);
$input['disabled'] = 'disabled';
}
if (in_array($_arrProp['type'], array('date', 'data', 'datetime')) && !isset($input['disabled'])) {
$input['class'] = isset($input['class']) ? $input['class'] : ' in-data';
}
if (in_array($_arrProp['type'], array('text'))) {
$input['type'] = 'textarea';
}
if (in_array($_arrProp['type'], array('decimal'))) {
$length = isset($_arrProp['length']) ? $_arrProp['length'] : null;
if (isset($length)) {
$input['maxlength'] = round($input['maxlength']) + round($input['maxlength']) / 3 - 1;
$length = substr($length, strpos($length, ',') + 1, strlen($length));
$this->esquema[$_field]['decimais'] = $length;
}
$input['class'] = isset($input['class']) ? $input['class'] : ' in-decimal';
}
$this->esquema[$_field]['input'] = $input;
}
if (USAR_CACHE === true) {
Cache::write('Esquema.' . $this->name, $this->esquema);
}
} else {
$this->esquema = $esquema;
}
}