本文整理汇总了PHP中Place类的典型用法代码示例。如果您正苦于以下问题:PHP Place类的具体用法?PHP Place怎么用?PHP Place使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Place类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: morePlaces
public function morePlaces()
{
$places = json_decode(file_get_contents(storage_path() . '/demo-day.json'), true);
$pages = $places['query']['pages'];
foreach ($pages as $page) {
$place = new Place();
if (isset($page['coordinates'])) {
$coords = $page['coordinates'][0];
$place->latitude = $coords['lat'];
$place->longitude = $coords['lon'];
}
if (isset($page['thumbnail'])) {
$thumbnail = $page['thumbnail'];
$place->img_src = $thumbnail['source'];
$place->img_width = $thumbnail['width'];
$place->img_height = $thumbnail['height'];
}
if (isset($page['extract'])) {
$place->description = $page['extract'];
}
$place->title = $page['title'];
$place->pageid = $page['pageid'];
$place->link = "https://en.wikipedia.org/?curid={$place->pageid}";
$place->save();
}
}
开发者ID:C-a-p-s-t-o-n-e,项目名称:capstone.dev,代码行数:26,代码来源:PlaceTableSeeder.php
示例2: getPlaceByCity
public function getPlaceByCity($citiesId, $placeType)
{
$placeList = $this->place->join('address', 'address.place_id', '=', 'place.id');
if (!empty($citiesId)) {
$placeList->whereIn('address.city_id', $citiesId);
}
$placeList->where('place.place_type_id', '=', $placeType);
return $placeList->get(['place.*']);
}
开发者ID:satyapraneel,项目名称:college,代码行数:9,代码来源:PlaceRepository.php
示例3: actionCreate
/**
* Creates a new City model.
* If creation is successful, the browser will be redirected to the 'view' page.
*
* @return mixed
*/
public function actionCreate($regionId)
{
$region = $this->findRegion($regionId);
$model = new Place(['region_id' => $region->id]);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('create', ['model' => $model]);
}
}
开发者ID:heartshare,项目名称:yii2-locations,代码行数:16,代码来源:CityController.php
示例4: actionCreate
/**
* 录入
*
*/
public function actionCreate()
{
parent::_acl();
$model = new Place();
if (isset($_POST['Place'])) {
$acl = $this->_gets->getPost('acl');
$model->attributes = $_POST['Place'];
if ($model->save()) {
AdminLogger::_create(array('catalog' => 'create', 'intro' => '录入内容,ID:' . $model->id));
$this->redirect(array('index'));
}
}
$this->render('placeRecommend_create', array('model' => $model));
}
开发者ID:tecshuttle,项目名称:51qsk,代码行数:18,代码来源:PlaceRecommendController.php
示例5: actionUpdatePlace
public function actionUpdatePlace()
{
$model = Place::model()->findByPk($_GET['id']);
$imageList = $this->_gets->getParam('imageList');
$imageListSerialize = XUtils::imageListSerialize($imageList);
if (isset($_POST['Place'])) {
$model->attributes = $_POST['Place'];
$model->pic_other = $imageListSerialize['dataSerialize'];
$file = XUpload::upload($_FILES['attach'], array('thumb' => true, 'thumbSize' => array(192, 470)));
$adr = XUpload::upload($_FILES['pic_adr'], array('thumb' => true, 'thumbSize' => array(498, 364)));
if (is_array($file)) {
$model->pic = $file['paththumbname'];
@unlink($_POST['oAttach']);
@unlink($_POST['oThumb']);
}
if (is_array($adr)) {
$model->pic_adr = $adr['paththumbname'];
@unlink($_POST['oAttach']);
@unlink($_POST['oThumb']);
}
if ($model->validate() && $model->save()) {
$this->redirect(array('/host/default/myplace'));
}
}
if ($imageList) {
$imageList = $imageListSerialize['data'];
} elseif ($model->pic_other) {
$imageList = unserialize($model->pic_other);
}
$this->render('addplace', array('model' => $model, 'imageList' => $imageList));
}
开发者ID:tecshuttle,项目名称:51qsk,代码行数:31,代码来源:DefaultController.php
示例6: showPlace
/**
* /
* @param [type] $id [description]
* @return [type] [description]
*/
public function showPlace($id)
{
$result = Place::query($this->db, 'showPublished', $id);
if ($result->isSuccessful()) {
$this->renderArray['place'] = $result->getRecords();
}
}
开发者ID:pedrokoblitz,项目名称:maltz,代码行数:12,代码来源:SecultSiteDataView.php
示例7: actionUpdatePlace
public function actionUpdatePlace()
{
$model = Place::model()->findByPk($_GET['id']);
if (isset($_POST['Place'])) {
$model->attributes = $_POST['Place'];
$file = XUpload::upload($_FILES['attach'], array('thumb' => true, 'thumbSize' => array(192, 470)));
$adr = XUpload::upload($_FILES['pic_adr'], array('thumb' => true, 'thumbSize' => array(498, 364)));
$other = XUpload::upload($_FILES['pic_other'], array('thumb' => true, 'thumbSize' => array(900, 600)));
if (is_array($file)) {
$model->pic = $file['paththumbname'];
@unlink($_POST['oAttach']);
@unlink($_POST['oThumb']);
}
if (is_array($adr)) {
$model->pic_adr = $adr['paththumbname'];
@unlink($_POST['oAttach']);
@unlink($_POST['oThumb']);
}
if (is_array($other)) {
$model->pic_other = $other['paththumbname'];
@unlink($_POST['oAttach']);
@unlink($_POST['oThumb']);
}
if ($model->validate() && $model->save()) {
$this->redirect(array('/host/default/myplace'));
}
}
$this->render('addplace', array('model' => $model));
}
开发者ID:tecshuttle,项目名称:51qsk,代码行数:29,代码来源:DefaultController.php
示例8: actionView
public function actionView($id)
{
$lesson = $this->loadModel($id);
$userId = $this->_cookiesGet('userId');
$userType = $this->_cookiesGet('userType');
$this->_seoTitle = '课程 - ' . $lesson->name;
//取报名人数
$actual_students_criteria = new CDbCriteria();
$actual_students = StudentLesson::model()->count($actual_students_criteria->addCondition("lesson_id =" . $id));
$lesson->actual_students = $actual_students;
$teacher = Teacher::model()->findByPk($lesson->teacher_id);
$place = Place::model()->findByPk($lesson->place_id);
//教学环境图片显示
$imageList = $this->_gets->getParam('imageList');
$imageListSerialize = XUtils::imageListSerialize($imageList);
//判断学员已收藏的课程
if ($userType === 'student') {
$is_focus = StudentLesson::model()->findByAttributes(array('student_id' => $userId, 'lesson_id' => $id, 'is_collection' => 1));
}
if ($imageList) {
$imageList = $imageListSerialize['data'];
} elseif ($place->pic_other) {
$imageList = unserialize($place->pic_other);
}
$this->render('view', array('is_focus' => $is_focus, 'isJoin' => $this->isJoin($userId, $id, 1), 'userType' => $userType, 'lesson' => $lesson, 'place' => $place, 'teacher' => $teacher, 'imageList' => $imageList));
}
开发者ID:tecshuttle,项目名称:51qsk,代码行数:26,代码来源:LessonController.php
示例9: GetByAssoc
public static function GetByAssoc($values)
{
$item = new PlaceHotspot();
$item->ID = $values["hotspot_ID"];
$item->Title = $values["hotspot_Title"];
$item->Left = $values["hotspot_Left"];
$item->Top = $values["hotspot_Top"];
$item->Width = $values["hotspot_Width"];
$item->Height = $values["hotspot_Height"];
$item->TargetPlace = Place::GetByID($values["hotspot_TargetPlaceID"]);
$item->TargetScript = $values["hotspot_TargetScript"];
$item->TargetURL = $values["hotspot_TargetURL"];
switch ($values["hotspot_TargetTypeID"]) {
case 1:
$item->TargetType = PlaceHotspotTargetType::URL;
break;
case 2:
$item->TargetType = PlaceHotspotTargetType::Script;
break;
case 3:
$item->TargetType = PlaceHotspotTargetType::Place;
break;
default:
$item->TargetType = PlaceHotspotTargetType::Unknown;
break;
}
return $item;
}
开发者ID:alcexhim,项目名称:PhoenixSNS,代码行数:28,代码来源:PlaceHotspot.inc.php
示例10: handleRequest
public function handleRequest()
{
$arr = array('idusers' => $_SESSION['UID']);
$content = Place::findMyPlaces($arr);
$friend = Friend::find($arr);
render('home', array('title' => "" . $_SESSION['UNAME'] . ' Welcome to the Places', 'content' => $content, 'friend' => $friend));
}
开发者ID:backandy,项目名称:theplaces,代码行数:7,代码来源:home.controller.php
示例11: placeFrom
private function placeFrom($id)
{
if ($cityFr = Place::where('id', '=', $id)->first()) {
return $cityFr->full_name;
} else {
return null;
}
}
开发者ID:charlieboo,项目名称:creatrip,代码行数:8,代码来源:MethodsProfile.php
示例12: uploadImage
public function uploadImage($placeId)
{
$place = Place::find($placeId);
if (!$place) {
return $this->errorNotFound('Place not found');
}
exit('This would normally upload an image somewhere but that is hard.');
}
开发者ID:rcuvgd,项目名称:Build-API..,代码行数:8,代码来源:PlaceController.php
示例13: loadModel
public function loadModel($id)
{
$model = Place::model()->findByPk($id);
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}
开发者ID:vasitjuntong,项目名称:carsnru,代码行数:8,代码来源:PlaceController.php
示例14: show
public function show($id)
{
$place = Place::find($id);
if (!$place) {
return $this->errorNotFound('Did you just invent an ID and try loading a place? Muppet.');
}
return $this->respondWithItem($place, new PlaceTransformer());
}
开发者ID:rcuvgd,项目名称:Build-API..,代码行数:8,代码来源:PlaceController.php
示例15: actionIndex
/**
* 首页
*
*/
public function actionIndex()
{
parent::_acl();
$model = new Place();
$criteria = new CDbCriteria();
$criteria->condition = $condition;
$criteria->order = 't.id DESC';
//$criteria->with = array ( 'catalog' );
$count = $model->count($criteria);
$pages = new CPagination($count);
$pages->pageSize = 13;
//$pageParams = XUtils::buildCondition( $_GET, array ( 'title' , 'catalogId','titleAlias' ) );
//$pages->params = is_array( $pageParams ) ? $pageParams : array ();
$criteria->limit = $pages->pageSize;
$criteria->offset = $pages->currentPage * $pages->pageSize;
$result = $model->findAll($criteria);
$this->render('place_index', array('datalist' => $result, 'pagebar' => $pages));
}
开发者ID:tecshuttle,项目名称:51qsk,代码行数:22,代码来源:PlaceController.php
示例16: getSelectPlaces
public function getSelectPlaces()
{
$placeModels = Place::find();
$places = [0 => 'Немає'];
foreach ($placeModels as $place) {
$places[$place->id] = $place->name;
}
return $places;
}
开发者ID:xsat,项目名称:www.test.com,代码行数:9,代码来源:Place.php
示例17: editar_empresa
public function editar_empresa()
{
$inputs = Input::get('idedit');
$fk_lugar = Place::lists('lugar_nombre', 'id');
$empresa = Empresa::find($inputs);
if ($empresa) {
return View::make('empresa.createEmpresa', array('empresa' => $empresa, 'fk_lugar' => $fk_lugar));
} else {
return Redirect::to('empresa');
}
}
开发者ID:bmrpas,项目名称:SHREDDER,代码行数:11,代码来源:EmpresaController.php
示例18: page
/**
*
* @param $pageId int
* @return nothing
* @author Tremor
*/
public function page($pageId = 0)
{
$this->data['active'] = __FUNCTION__;
if (isset($pageId) && !empty($pageId) && is_numeric($pageId)) {
$this->data['placeList'] = Place::lists('name', 'id');
$this->data['page'] = Page::find($pageId);
return View::make('admin.page.one')->with($this->data);
} else {
$this->data['pageList'] = Page::orderBy('place_id')->orderBy('sort')->get();
return View::make('admin.page.list')->with($this->data);
}
}
开发者ID:tremor-od,项目名称:pizza.loc,代码行数:18,代码来源:AdminController.php
示例19: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$faker = Faker::create();
for ($i = 0; $i < 100; $i++) {
$place = Place::create(['name' => $faker->name, 'lat' => $faker->latitude, 'lon' => $faker->longitude, 'address1' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->stateAbbr, 'zip' => rand(10000, 30000), 'website' => $faker->url, 'phone' => $faker->phoneNumber]);
foreach (User::all() as $user) {
if (rand(0, 2) == 1) {
$place->checkins()->create(['user_id' => $user->id]);
}
}
}
}
开发者ID:rcuvgd,项目名称:Build-API..,代码行数:17,代码来源:PlaceTableSeeder.php
示例20: testPopulateWithPlace
public function testPopulateWithPlace()
{
$point = new Point();
$point->setLat('-23.59243454');
$point->setLng('-46.68677054');
$city = new City();
$city->setCountry('BR');
$city->setState('SP');
$city->setName('São Paulo');
$category = new Category();
$category->setId('123');
$category->setName('Empresas de Internet');
$address = new Address();
$address->setStreet("Rua Funchal");
$address->setNumber(129);
$address->setComplement('6o andar');
$address->setCity($city);
$place = new Place();
$place->setId("M25GJ288");
$place->setName("Apontador.com - São Paulo");
$place->setDescription("Líder em geolocalização no Brasil e uma das 250 maiores empresas de internet do mundo, segundo o AlwaysOn, o Apontador (www.apontador.com) desenvolve e oferece serviços e ferramentas de busca e localização para facilitar o dia a dia dos usuários, além de mostrar a opinião do público para os locais cadastrados em seus sites. Com mais de 10 milhões de visitantes mensais, a empresa inclui o site líder em busca local Apontador (www.apontador.com.br) e o de mapas e rotas MapLink (www.maplink.com.br).");
$place->setIconUrl("http://localphoto.s3.amazonaws.com/C40372534F143O1437_9896391605729015_l.jpg");
$place->setPoint($point);
$place->setCategory($category);
$place->setAddress($address);
$this->og->populate($place);
$rootUrl = \ROOT_URL;
$testMeta = <<<META
\t<meta property="og:title" content="Apontador.com - São Paulo"/>
\t<meta property="og:description" content="Líder em geolocalização no Brasil e uma das 250 maiores empresas de internet do mundo, segundo o AlwaysOn, o Apontador (www.apontador.com) desenvolve e oferece serviços e ferramentas de busca e localização para facilitar o dia a dia dos usuários, além de mostrar a opinião do público para os locais cadastrados em seus sites. Com mais de 10 milhões de visitantes mensais, a empresa inclui o site líder em busca local Apontador (www.apontador.com.br) e o de mapas e rotas MapLink (www.maplink.com.br)."/>
\t<meta property="og:image" content="http://maplink.com.br/widget?v=4.1&lat=-23.59243454&lng=-46.68677054"/>
\t<meta property="og:url" content="{$rootUrl}sp/s-o-paulo/empresas-de-internet/apontador-com-s-o-paulo/M25GJ288.html"/>
\t<meta property="og:street-address" content="Rua Funchal, 129"/>
\t<meta property="og:locality" content="São Paulo"/>
\t<meta property="og:region" content="SP"/>
\t<meta property="og:country-name" content="Brasil"/>
\t<meta property="og:latitude" content="-23.59243454"/>
\t<meta property="og:longitude" content="-46.68677054"/>
\t<meta property="og:type" content="company"/>
META;
$this->assertEquals($testMeta, $this->og->getMeta());
$testArray = array('title' => 'Apontador.com - São Paulo', 'description' => 'Líder em geolocalização no Brasil e uma das 250 maiores empresas de internet do mundo, segundo o AlwaysOn, o Apontador (www.apontador.com) desenvolve e oferece serviços e ferramentas de busca e localização para facilitar o dia a dia dos usuários, além de mostrar a opinião do público para os locais cadastrados em seus sites. Com mais de 10 milhões de visitantes mensais, a empresa inclui o site líder em busca local Apontador (www.apontador.com.br) e o de mapas e rotas MapLink (www.maplink.com.br).', 'image' => 'http://maplink.apontador.com.br/widget?v=4.1&lat=-23.59243454&lng=-46.68677054', 'url' => ROOT_URL . 'sp/s-o-paulo/empresas-de-internet/apontador-com-s-o-paulo/M25GJ288.html', 'street-address' => 'Rua Funchal, 129', 'locality' => 'São Paulo', 'region' => 'SP', 'country-name' => 'Brasil', 'latitude' => '-23.59243454', 'longitude' => '-46.68677054', 'type' => 'company');
$this->assertEquals($testArray, $this->og->getArray());
}
开发者ID:EHER,项目名称:chegamos,代码行数:45,代码来源:OpenGraphTest.php
注:本文中的Place类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论