本文整理匯總了PHP中app\models\Profile::select方法的典型用法代碼示例。如果您正苦於以下問題:PHP Profile::select方法的具體用法?PHP Profile::select怎麽用?PHP Profile::select使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\models\Profile
的用法示例。
在下文中一共展示了Profile::select方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ajaxUrlChecking
/**
* Checking Page Url .
*
* @return \Illuminate\Http\Response
*/
public function ajaxUrlChecking(Request $request)
{
$id = $request->get('id');
$action = strtolower(html_entity_decode($request->get('action')));
/*
* profile functionality
*/
if ($action == 'trap.it feed') {
$content = @file_get_contents($id);
try {
$x = new \SimpleXmlElement($content);
} catch (\Exception $ex) {
echo 'invalid';
die;
}
if (empty($content)) {
echo 'invalid';
die;
}
$counter = 0;
foreach ($x->entry as $entry) {
if ($entry->link['href'][0]) {
$counter++;
}
}
if ($counter > 0) {
echo 'valid';
} else {
echo 'invalid';
}
die;
}
if ($action == 'rss_feed') {
$content = @file_get_contents($id);
if (empty($content)) {
echo 'invalid';
die;
}
try {
$x = new \SimpleXmlElement($content);
if (isset($x->channel->item)) {
$counter = 0;
foreach ($x->channel->item as $entry) {
$counter++;
}
if ($counter > 0) {
echo 'valid';
} else {
echo 'invalid';
}
die;
}
} catch (\Exception $ex) {
echo 'invalid';
die;
}
}
if ($action == 'profile') {
$get_profile_info = Profile::select()->where('id', $id)->get()->toArray();
$data_array = array();
if (empty($get_profile_info)) {
$get_profile_info = User::select()->where('id', $id)->get()->toArray();
foreach ($get_profile_info as $key => $val) {
$data_array = array('name' => $val['name'], 'url' => $val['homeurl'], 'pic' => "/images/profiles/" . $val['image']);
}
} else {
foreach ($get_profile_info as $key => $val) {
$data_array = array('name' => $val['child_name'], 'url' => $val['child_home_url'], 'pic' => "/images/profiles/" . $val['child_pic']);
}
}
echo json_encode($data_array);
}
}