本文整理汇总了PHP中AppModel::view方法的典型用法代码示例。如果您正苦于以下问题:PHP AppModel::view方法的具体用法?PHP AppModel::view怎么用?PHP AppModel::view使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppModel
的用法示例。
在下文中一共展示了AppModel::view方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view
public function view($id = 0)
{
$this->fields['file_name']['type'] = 'download';
$this->fields['file_name']['attr'] = array('url' => array('action' => get_class($this), 'download', $id));
$this->fields['file_content']['visible'] = false;
parent::view($id);
$this->render = 'view';
}
示例2: view
public function view($id = 0)
{
parent::view($id);
$id = $this->Session->read('Student.data.SecurityUser.id');
$mainPhone = $this->getPreferredPhone($id);
$mainEmail = $this->getPreferredEmail($id);
$this->Session->write('Student.data.mainPhone', $mainPhone);
$this->Session->write('Student.data.mainEmail', $mainEmail);
$this->set('mainPhone', $mainPhone);
$this->set('mainEmail', $mainEmail);
$this->render = 'view';
}
示例3: view
public function view($id = 0)
{
parent::view($id);
$type = $this->controller->params->named['type'];
$data = $this->controller->viewVars['data'];
$valueType = $data[$this->alias]['value_type'];
if (!empty($valueType)) {
switch ($valueType) {
case 'toggleVal':
$this->fields['value']['type'] = 'toggleVal';
break;
case 'dropdown':
$options = $this->ConfigItemOption->find('list', array('fields' => array('value', 'name'), 'conditions' => array('config_item_id' => $id), 'order' => array('order')));
$this->fields['value']['type'] = 'select';
$this->fields['value']['options'] = $options;
break;
default:
break;
}
}
$this->setVar('type', $type);
$this->render = 'view';
}
示例4: view
public function view($id = 0)
{
parent::view($id);
$this->render = 'view';
}