本文整理汇总了PHP中Exercise::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Exercise::get方法的具体用法?PHP Exercise::get怎么用?PHP Exercise::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exercise
的用法示例。
在下文中一共展示了Exercise::get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exercise_get
public function exercise_get($id = null)
{
$user = new User($this->user_id);
$exercise = new Exercise();
$exercise->where('id', $id);
$exercise->get();
$logs = $exercise->exerciselog;
$logs->get();
$response = array();
foreach ($logs as $log) {
array_push($response, $log->getData());
}
$this->response($response);
}
示例2: find
public function find()
{
$this->load->library('table');
$this->load->helper('form');
if ($this->input->post()) {
$search = $this->input->post('search');
// TODO do not get the current users's exercises
$exercises = new Exercise();
$exercises->or_like('name', $search);
$exercises->or_like('description', $search);
$exercises->get();
foreach ($exercises as $ex) {
$data['exercises'][$ex->id] = array('id' => $ex->id, 'name' => $ex->name, 'description' => $ex->description);
}
}
// Load Page
$data['title'] = 'Find Exercises';
$data['content'] = 'exercises/find';
$this->load->view('master', $data);
}