本文整理汇总了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);
}
}