本文整理汇总了PHP中View::setModel方法的典型用法代码示例。如果您正苦于以下问题:PHP View::setModel方法的具体用法?PHP View::setModel怎么用?PHP View::setModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View::setModel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setModel
function setModel($m)
{
$m = parent::setModel($m);
$complete = $this->add('xepan\\projects\\View_Progressbar', null, 'totalprogress', ['view\\progressbar']);
$complete->template->set('total_task', $m['total_task']);
$complete->template->set('completed_percentage', $m['completed_percentage']);
$complete->template->set('color', $m['color']);
$complete->template->set('critical_completed_percentage', abs($m['critical_completed_percentage'] - 100));
$complete->template->set('high_completed_percentage', abs($m['high_completed_percentage'] - 100));
$complete->template->set('medium_completed_percentage', abs($m['medium_completed_percentage'] - 100));
$complete->template->set('low_completed_percentage', abs($m['low_completed_percentage'] - 100));
$complete->template->set('title', 'Total Tasks');
$self = $this->add('xepan\\projects\\View_Progressbar', null, 'selfprogress', ['view\\progressbar']);
$self->template->set('self_task', $m['self_task']);
$self->template->set('self_percentage', $m['self_percentage']);
$self->template->set('self_color', $m['self_color']);
$self->template->set('critical_self_percentage', abs($m['critical_self_percentage'] - 100));
$self->template->set('high_self_percentage', abs($m['high_self_percentage'] - 100));
$self->template->set('medium_self_percentage', abs($m['medium_self_percentage'] - 100));
$self->template->set('low_self_percentage', abs($m['low_self_percentage'] - 100));
$self->template->set('title', 'Your Tasks');
// $this->js('click')->_selector('.do-view-project-details')->univ()->frameURL('Project Details',[$this->api->url('xepan_projects_projectdetail'),'project_id'=>$this->js()->_selectorThis()->closest('[data-id]')->data('id')]);
$this->js('click')->_selector('.do-view-project-lives-details')->univ()->frameURL('Employee Status', [$this->api->url('xepan_projects_projectlive'), 'project_id' => $this->js()->_selectorThis()->closest('[data-id]')->data('id')]);
$this->js('click')->_selector('.do-view-project-all-task-lists')->univ()->frameURL('Task/Request List', [$this->api->url('xepan_projects_projecttasklist'), 'project_id' => $this->js()->_selectorThis()->closest('[data-id]')->data('id')]);
// $this->js('click')->_selector('.do-view-project-calendar')->univ()->frameURL('Project Calendar',[$this->api->url('xepan_projects_calendar'),'project_id'=>$this->js()->_selectorThis()->closest('[data-id]')->data('id')]);
// $this->js('click')->_selector('.do-view-project-progress')->univ()->frameURL('Project Conversation',[$this->api->url('xepan_projects_progress'),'project_id'=>$this->js()->_selectorThis()->closest('[data-id]')->data('id')]);
// $this->js('click')->_selector('.do-view-project-conversion')->univ()->frameURL('Project Files',[$this->api->url('xepan_projects_conversation'),'project_id'=>$this->js()->_selectorThis()->closest('[data-id]')->data('id')]);
return $m;
}
示例2: setModel
function setModel($m)
{
if (!$m instanceof Model_Hosteler) {
throw $this->exception('Model can be only Hosteler');
}
parent::setModel($m);
$this->information_grid->setModel($m, array('name', 'father_name', 'room_no', 'building_name', 'attendance_status', 'image_url'));
$m->tryLoadAny();
if (!$m->loaded()) {
$this->gaurdian_grid->destroy();
$this->information_grid->destroy();
$this->form->destroy();
return;
}
$this->hosteler = $m;
$this->gaurdian_grid->setModel($m->ref('scholar_id')->ref('Scholars_Guardian'), array('gname', 'address', 'contact', 'relation', 'image_url'));
$this->form->getElement('hosteler_id')->set($m->id);
// $map = $this->add('Model_Scholars_Guardian');
$sel = $this->form->getElement('sel');
$this->gaurdian_grid->addSelectable($sel);
// if($this->form->isSubmitted()){
// $this->form->js()->univ()->successMessage("Student ID" . $this->form->get('hosteler_id'))->execute();
// // $this->handelForm($this->form);
// }
}
示例3: setModel
function setModel($m)
{
parent::setModel($m);
$l = $this->api->add('listers/Lister_Tree', null, 'tree');
$l->setModel($m);
$l->setRelationFields('id', 'parent_id');
$l->js(true)->univ()->jstreePlugin();
}
示例4: setModel
function setModel($model, $fields = null)
{
$m = parent::setModel($model, $fields);
if ($this->add_option_helper) {
$this->add('xepan\\cms\\Controller_Tool_Optionhelper');
}
return $m;
}
示例5: setModel
function setModel($model, $fields = null, $grid_fields = null)
{
parent::setModel($model);
if ($this->form) {
$m = $this->form->setModel($this->model, $fields);
$this->form->addSubmit();
} else {
$m = $this->grid->setModel($this->model, $grid_fields ? $grid_fields : $fields);
}
$this->initComponents();
return $m;
}
示例6: setModel
function setModel($model)
{
parent::setModel($model);
$model->tryLoadAny();
$this->template->trySet('val1', $model['average_receiving_time']);
$this->template->trySet('val2', $model['average_submission_time']);
$this->template->trySet('val3', $model['average_reacting_time']);
$this->template->trySet('val4', 0);
$this->template->trySet('heading1', 'Average Receiving Time');
$this->template->trySet('heading2', 'Average Submission Time');
$this->template->trySet('heading3', 'Average Reacting Time');
$this->template->trySet('heading4', 'Dummy');
}
示例7: setModel
function setModel($scholar)
{
$student = $scholar->ref('Student');
$student->addExpression('class_section')->set(function ($m, $q) {
return $m->refSQL('class_id')->fieldQuery('section');
})->display('hindi');
$student->addExpression('className')->set(function ($m, $q) {
return $m->refSQL('class_id')->fieldQuery('class_name');
})->display('hindi');
$this->add('View_Scholar_Details', null, 'details_location')->setModel($student);
$this->template->tryset('date_of_birth', date('d-m-Y', strtotime($scholar['dob'])));
$this->template->tryset('admissiondate', date('d-m-Y', strtotime($scholar['admission_date'])));
parent::setModel($scholar);
}
示例8: setModel
function setModel($model)
{
parent::setModel($model);
if (!$this->model->loaded()) {
return;
}
$f = $this->add('Form');
foreach ($this->model->ref('RuleOption') as $model) {
if (preg_match_all("/{[^}]*}/", $model['gMarks'], $tags)) {
foreach ($tags as $key => $value) {
foreach ($value as $key_id => $value_name) {
$f->addField($value_name)->validate('required');
}
}
}
}
$f->addSubmit('Go');
if ($f->isSubmitted()) {
$m = $this->model;
$rule = $this->add('Model_Rule');
foreach ($m->getActualFields() as $field) {
if (in_array($field, ["id", "is_template"])) {
continue;
}
$rule[$field] = $m[$field];
}
$rule->save();
foreach ($m->ref('RuleOption') as $rbo) {
$ro = $this->add('Model_RuleOption');
$ro['rule_id'] = $rule->id;
foreach ($rbo->getActualFields() as $field) {
if ($field == "id") {
continue;
}
if (preg_match_all("/{[^}]*}/", $rbo['gMarks'], $tags)) {
foreach ($tags as $key => $values) {
foreach ($values as $key => $value) {
$rbo[$field] = str_replace($value, $f[$this->api->normalizeName($value)], $rbo[$field]);
}
}
}
$ro[$field] = $rbo[$field];
}
$ro->saveAndUnload();
}
$this->api->stickyForget('rulebook_id');
$f->js(null, $this->owner->js()->reload())->univ()->successMessage('ok')->execute();
}
}
示例9: setModel
function setModel($m)
{
$upsthiti = 0;
$total_meeting = 0;
foreach ($m as $junk) {
$this->template->trySet("total_" . $m['month'], $m['total_attendance']);
$this->template->trySet("att_" . $m['month'], $m['present']);
$upsthiti += $m['total_attendance'];
$total_meeting += $m['present'];
// echo $month;
}
$this->template->trySet("total_meeting", $total_meeting);
$this->template->trySet("total_att", $upsthiti);
parent::setModel($m);
}
示例10: setModel
public function setModel($m)
{
$m = parent::setModel($m);
foreach ($m as $model) {
// check subitems
if (@$model->hierarchy_controller && $model[$model->hierarchy_controller->child_ref . '_cnt']) {
$m = $this->addMenu($model['name']);
foreach ($model->ref($model->hierarchy_controller->child_ref) as $child) {
$m->addItem($child['name'], $child['page']);
}
} else {
$this->addItem($model['name'], $model['page']);
}
}
}
示例11: setModel
public function setModel($m, $options = array())
{
$m = parent::setModel($m);
foreach ($m as $model) {
// check subitems
if (@$model->hierarchy_controller && $model[strtolower($model->hierarchy_controller->child_ref) . '_cnt']) {
$m = $this->addMenu($model[$options['title_field'] ?: $m->title_field]);
foreach ($model->ref($model->hierarchy_controller->child_ref) as $child) {
$m->addItem($options['title_field'] ?: $child[$options['title_field'] ?: $model->title_field], $child['page']);
}
} else {
$this->addItem($model[$options['title_field'] ?: $model->title_field], $model['page']);
}
}
return $m;
}
示例12: setModel
function setModel($m)
{
parent::setModel($m);
$student = $m->ref('Student')->addCondition('session_id', $this->add('Model_Sessions_Current')->fieldQuery('id'))->tryLoadAny();
// $student=$this->add('Model_Student');
$sc = $student->join('scholars_master.id', 'scholar_id');
$sc->addField('guardian_name');
$this->template->set('class', $student->ref('class_id')->get('name'));
$this->template->trySet('roll_no', $student['roll_no']);
$this->template->trySet('dob1', date('d/m/Y', strtotime($m['dob'])));
$sch = $student->ref('scholar_id');
// $g=$sch->ref('Scholars_Guardian')->setOrder('id','desc')->tryLoadAny();
// if($g['name']==$sch['mother_name'])
// $g->setOrder('name','asc');
// else
// $g->setOrder('name','desc');
$this->template->trySet('guardian_name', $student['guardian_name']);
}
示例13: setModel
function setModel($model)
{
$m = parent::setModel($model);
$to_raw = $m['to_raw'];
$to_lister = $this->add('CompleteLister', null, 'to_lister', ['view/emails/email-detail', 'to_lister']);
// var_dump($m['to_raw']);
// exit;
$to_lister->setSource($to_raw);
$cc_raw = $m['cc_raw'];
$cc_lister = $this->add('CompleteLister', null, 'cc_lister', ['view/emails/email-detail', 'cc_lister']);
$cc_lister->setSource($cc_raw);
$this->template->setHTML('email_body', $model['description']);
$this->template->setHTML('attachment_count', $model['attachment_count']);
if (!$model['attachment_count']) {
$this->template->tryDel('check_attach');
}
$attach_m = $this->add('xepan\\communication\\Model_Communication_Attachment');
$attach_m->addCondition('communication_id', $m->id);
$attach_m->addCondition('type', 'attach');
$attach = $this->add('xepan\\communication\\View_Lister_Attachment', null, 'Attachments');
$attach->setModel($attach_m);
// $(".reply").click(function(){
// $('.compose-email-view-popup').show();
// });
// $("li.reply-all").click(function(){
// $('.compose-email-view-popup').show();
// });
// $("li.forward").click(function(){
// $('.compose-email-view-popup').show();
// });
$this->js('click', [$this->js()->show()->_selector('.compose-email-view-popup'), $this->js()->reload()])->_selector('.reply');
$this->js('click', [$this->js()->show()->_selector('.compose-email-view-popup'), $this->js()->reload()])->_selector('li.reply-all');
$this->js('click', [$this->js()->show()->_selector('.compose-email-view-popup'), $this->js()->reload()])->_selector('li.forward');
$this->add('xepan\\base\\Controller_Avatar', ['options' => ['size' => 45, 'border' => ['width' => 0]], 'name_field' => 'communication_with', 'default_value' => '']);
return $m;
}
示例14: setModel
function setModel($model, $view_fields = null, $form_fields = null)
{
$this->view_fields = $view_fields;
$this->form_fields = $form_fields;
if ($this->action == 'view') {
$fields = $view_fields;
} else {
foreach ($this->form_fields as $fld) {
if ($model->getElement($fld)->system()) {
$model->getElement($fld)->system(false)->editable(true);
}
}
$m = $this->form->setModel($model, $this->form_fields);
$fields = $view_fields ?: $m->getActualFields();
/* Still NonEditable fields should show as on view mode */
$readonly_fields = array_diff($fields, $this->form_fields ?: []);
// remove derefrenced_fields
$remove_tag = [];
foreach ($readonly_fields as $key => $rf) {
if (in_array($rf . '_id', $this->form_fields) && !in_array($rf . '_id', $this->deref_fields_in_form)) {
unset($readonly_fields[$key]);
}
}
foreach ($readonly_fields as $fld) {
@$this->form->layout->template->trySetHTML($fld, $model[$fld]);
}
}
$m = parent::setModel($model, $fields);
return $m;
}
示例15: setModel
function setModel($m)
{
parent::setModel($m);
$this->child_ref = $this->model->hierarchy_controller->child_ref;
return $this->model;
}