本文整理匯總了PHP中type::getAttribute方法的典型用法代碼示例。如果您正苦於以下問題:PHP type::getAttribute方法的具體用法?PHP type::getAttribute怎麽用?PHP type::getAttribute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類type
的用法示例。
在下文中一共展示了type::getAttribute方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _create
/**
* Cria os arquivos do CRUD
*
* @param type $profile
* @param type $table
* @param type $adapter
* @param type $module
* @param type $overwrite
* @throws Zend_Tool_Project_Provider_Exception
*/
private function _create($profile, $table, $adapter, $module, $overwrite)
{
$this->_registry->getRequest()->isPretend();
$this->_print(' Criando CRUD ');
$this->_print(' table: ' . $table . ' | adapter : ' . $adapter . ' | module: ' . $module);
$table = strtolower($table);
$module = strtolower($module);
$path = $profile->getAttribute('projectDirectory');
$dirModules = $path . '/application/configs/modules';
if (!is_dir($dirModules)) {
mkdir($dirModules);
}
$dirModule = $dirModules . '/' . $module;
if (!is_dir($dirModule)) {
mkdir($dirModule);
}
$fileName = $dirModule . '/' . $table . '.php';
if (!file_exists($fileName)) {
throw new Zend_Tool_Project_Provider_Exception('Para executar essa ação é necessário criar o arquivo ' . $fileName);
}
$config = (require $fileName);
$this->_print(' Criando Tables ');
ZendT_Tool_Crud_Table::create($path, $config);
$this->_print(' Criando Mappers ');
ZendT_Tool_Crud_Mapper::create($path, $config);
$this->_print(' Criando MapperView ');
ZendT_Tool_Crud_MapperView::create($path, $config);
$this->_print(' Criando Element ');
ZendT_Tool_Crud_Element::create($path, $config);
$this->_print(' Criando Form ');
ZendT_Tool_Crud_Form::create($path, $config);
$this->_print(' Criando Controller ');
ZendT_Tool_Crud_Controller::create($path, $config, $overwrite);
$this->_print(' Criando Service ');
ZendT_Tool_Crud_Service::create($path, $config);
$this->_print(' Criando Language ');
ZendT_Tool_Crud_Language::create($path, $config);
$this->_print(' Criando Bootstrap ');
ZendT_Tool_Crud_Bootstrap::create($path, $config);
$this->_print(' Criando View ');
ZendT_Tool_Crud_View::create($path, $config);
}
示例2: isDateDMY
/**
* check if this date has any date qualifiers. Return true if no date qualifiers are found.
*
* @param type $fact
* @return boolean
*/
private function isDateDMY($fact)
{
if ($fact && !preg_match('/^(FROM|BET|TO|AND|BEF|AFT|CAL|EST|INT|ABT) (.+)/', $fact->getAttribute('DATE'))) {
return true;
}
}
示例3: render
/**
* TODO: Create this description
*
* @param type $model
* @return string
*/
public function render($model)
{
//$array = $model->getAttributes($this->_modelFormatType);
/**
* The extract function makes the array keys available as variables in the current function scope.
* we need this for the eval functoion.
*
* example $array = array('name'=>'Pete'); becomes $name='Pete';
*
* In the column definition we can supply a format like this:
*
* 'format'=>'$name'
*/
//extract($array);
extract($this->_extraVars);
if (isset($this->_format)) {
$result = '';
if ($this->_format != '') {
eval('$result=' . $this->_format . ';');
}
return $result;
} elseif (isset($model->{$this->_dataindex})) {
if ($model instanceof \GO\Base\Db\ActiveRecord) {
return $model->getAttribute($this->_dataindex, $this->_modelFormatType);
}
return $model->{$this->_dataindex};
} else {
return "";
}
}
示例4: getElementComponentContent
/**
*
* @param type $component
* @param type $content
* @return type
*/
static function getElementComponentContent($component, $type, $content)
{
if ($component->getAttribute('bearcms-internal-attribute-container') === 'none') {
return $content;
}
$attributes = '';
if ($component->editable === 'true') {
$htmlElementID = 'brelc' . md5($component->id);
ElementsHelper::$editorData[] = ['element', $component->id, self::getComponentContextData($component), $type];
$attributes .= ' id="' . $htmlElementID . '"';
}
return '<div' . $attributes . '>' . $content . '</div>';
}
示例5: buildOptionValue
/**
* Returns option value with associated disabled flag
*
* @param type $node
*
* @return array
*/
private function buildOptionValue($node)
{
$option = array();
$defaultValue = isset($node->nodeValue) && !empty($node->nodeValue) ? $node->nodeValue : '1';
$option['value'] = $node->hasAttribute('value') ? $node->getAttribute('value') : $defaultValue;
$option['disabled'] = $node->hasAttribute('disabled') && $node->getAttribute('disabled') == 'disabled';
return $option;
}
示例6: retrieveClassesForElement
/**
* Retrieves classes for element
*
* @param type $element NodeElement
*
* @return array without t_ already
*/
private function retrieveClassesForElement($element)
{
$classes = $element->getAttribute('class');
$matches = array();
preg_match_all('/t_([a-zA-Z0-9\\_]+)/', $classes, $matches);
return $matches[1];
}