本文整理汇总了PHP中Forms::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Forms::where方法的具体用法?PHP Forms::where怎么用?PHP Forms::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Forms
的用法示例。
在下文中一共展示了Forms::where方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editLetterName
public function editLetterName()
{
// Declare the rules for the form validation
$rules = array('rname' => 'required');
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
$data['status'] = 'error';
$data['errors'] = $validator->messages()->toArray();
} else {
$form_id = Input::get('form_id');
$form = Forms::where('id', $form_id)->first();
$form->name = Input::get('rname');
if ($form->save()) {
$data['status'] = 'success';
} else {
$data['status'] = 'error';
}
}
return Response::json($data);
}
示例2: postPfTemplateSelectList
public function postPfTemplateSelectList($destination)
{
$query = Forms::where('pid', '=', Session::get('pid'))->where('forms_destination', '=', $destination)->get();
$data['options'] = array();
if ($query) {
$data['options'][''] = "*Select completed forms below.";
foreach ($query as $row) {
$data['options'][$row->forms_id] = $row->forms_title . ", completed on " . date('m/d/Y', $this->human_to_unix($row->forms_date));
}
} else {
$data['options'][''] = "No forms completed by patient.";
}
echo json_encode($data);
}
示例3: getEmbedForm
public function getEmbedForm($id = null)
{
if ($form = Forms::where('unique_id', $id)->where('status', 'active')->first()) {
$form = Forms::where('unique_id', $id)->where('status', 'active')->first();
$fields = FormFields::where('form_id', $form->id)->get();
return View::make('frontend/forms/embed', compact('form', 'fields'));
}
}