本文整理汇总了PHP中Illuminate\Support\Facades\Lang::locale方法的典型用法代码示例。如果您正苦于以下问题:PHP Lang::locale方法的具体用法?PHP Lang::locale怎么用?PHP Lang::locale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Lang
的用法示例。
在下文中一共展示了Lang::locale方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTourCategory
public function getTourCategory($subcategory_id)
{
$subCategory = DB::table('jos_estateagent_tour_subcategory')->where('TOUR_SUBCATEGORY', $subcategory_id)->first();
$titleCategory = Translations::getTranslation($subCategory->TOUR_CATEGORY, 'jos_estateagent_tour_category', 'tour_category_title', Lang::locale())->value;
$titleSubCategory = Translations::getTranslation($subcategory_id, 'jos_estateagent_tour_subcategory', 'tour_subcategory_title', Lang::locale())->value;
return array($titleCategory, $titleSubCategory);
}
示例2: show
public function show($tourSlug, $tour_code)
{
$tourDetails = Tours::where('tour_code', $tour_code)->first();
$title = Translations::getTranslation($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_title', Lang::locale())->value;
$description = Translations::getTranslation($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_description', Lang::locale())->value;
$destination = Tours::firstOrFail()->destination;
$parentDestination = Tours::firstOrFail()->parentDestination;
$prvi_datum = "";
$drugi_datum = "";
$event_time = "";
$time = "";
$event_time_end = "";
if ($tourDetails->is_event == 1) {
if ($tourDetails->tour_date != '0000-00-00') {
$timestampEventDate = strtotime($tourDetails->tour_date);
$prvi_datum = " " . date("d.m.Y", $timestampEventDate) . " ";
if ($tourDetails->tour_date_end == '0000-00-00') {
$drugi_datum = " ";
} elseif ($tourDetails->tour_date_end != '0000-00-00') {
$timestampEventDate = strtotime($tourDetails->tour_date_end);
$drugi_datum = "- " . date("d.m.Y", $timestampEventDate) . " ";
}
}
if ($tourDetails->tour_time != '00:00:00') {
$event_time = date('H:i', strtotime($tourDetails->tour_time)) . " " . Lang::get('lang.EventHours') . " ";
$time = Lang::get('lang.EventTime');
if ($tourDetails->tour_time_end != '00:00:00') {
$event_time_end = " - " . date('H:i', strtotime($tourDetails->tour_time_end)) . " " . Lang::get('lang.EventHours');
} else {
$event_time_end = ' ';
}
} else {
$event_time = ' ';
$time = "";
$event_time_end = ' ';
}
}
$duration_sintax = '';
if ($tourDetails->tour_duration != "0" && $tourDetails->tour_duration_unit != "0") {
if ($tourDetails->tour_duration == 1) {
$duration_sintax = Lang::get('lang.Tour' . substr_replace($tourDetails->tour_duration_unit, "", -1));
} elseif ($tourDetails->tour_duration > 1) {
$duration_sintax = Lang::get('lang.Tour' . $tourDetails->tour_duration_unit);
} else {
$duration_sintax = '';
}
}
$tourMainImage = $tourDetails->getMainTourImage($tourDetails->TOUR_ID);
list($tourCategory, $tourSubCategory) = $tourDetails->getTourCategory($tourDetails->TOUR_SUBCATEGORY);
$tourIcon = $tourDetails->getTourIcon($tourDetails->ICON_ID);
$profileImage = $tourDetails->getTourProfileImage($tourDetails->tour_profile_image);
return view('tours.show', compact('tourDetails', 'title', 'destination', 'parentDestination', 'description', 'tourMainImage', 'tourCategory', 'tourSubCategory', 'tourIcon', 'profileImage', 'prvi_datum', 'drugi_datum', 'event_time', 'time', 'event_time_end', 'duration_sintax'));
}
示例3: show
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($alias)
{
$aliasLang = 'alias' . getLangAlias(Lang::locale());
$houseDetails = Houses::where($aliasLang, $alias)->first();
list($apartments, $rooms, $houses, $countpersons) = $houseDetails->countUnitsInHouse($houseDetails->id);
if ($houseDetails->destination->parent == 0) {
$destinationName = getTranslate($houseDetails->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
$parentDestinationName = "";
} else {
$destinationName = getTranslate($houseDetails->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
$parentDestinationName = getTranslate($houseDetails->destination->parent, 'jos_estateagent_town', 'title', Lang::locale())->value;
}
$title = $houseDetails->name;
$meta_title = $houseDetails->getHouseTitleName($houseDetails->jos_estateagent_house_title_id) . ' ' . $houseDetails->name;
if ($parentDestinationName != '') {
$meta_title .= ' | ' . $parentDestinationName;
}
$meta_title .= ' | ' . $destinationName . ' | ' . $houseDetails->getHouseTitleName($houseDetails->jos_estateagent_house_title_id) . ' ' . $houseDetails->name;
$meta_description = Lang::get('lang.MetaDescriptionPrivateURL');
if (getTranslate($houseDetails->id, 'jos_estateagent_house', 'description', Lang::locale())->value != '') {
$meta_description .= getTranslate($houseDetails->id, 'jos_estateagent_house', 'description', Lang::locale())->value;
} else {
if (getTranslate($houseDetails->id, 'jos_estateagent_house', 'description', Lang::locale())->value != '') {
$meta_description .= getTranslate($houseDetails->id, 'jos_estateagent_house', 'description', Lang::locale())->value;
} else {
$meta_description .= getTranslate($houseDetails->town_id, 'jos_estateagent_town', 'description', Lang::locale())->value;
}
}
$meta_description_all = strip_tags(shorttext($meta_description, 120));
$description = getTranslate($houseDetails->id, 'jos_estateagent_house', 'description', Lang::locale())->value;
$houseImages = Houses::find($houseDetails->id)->HouseImages;
if ($houseImages->isEmpty()) {
$houseMainImage = "nophoto.jpg";
} else {
$houseMainImage = Houses::find($houseDetails->id)->HouseImages()->first()->fname;
}
$ownerTours = $houseDetails->owner->getOwnerTours($houseDetails->jos_users_id);
$getCategoryLinks = Destinations::find($houseDetails->town_id)->DestinationCategoryLinks;
$categoryTitleLang = "jos_estateagent_town_category_links_" . Lang::locale();
$getLinks = Destinations::find($houseDetails->town_id)->DestinationLinks->where('jos_estateagent_town_links_publish', 1);
$titleLang = "jos_estateagent_town_links_title_" . Lang::locale();
$linkLang = "jos_estateagent_town_links_url_" . Lang::locale();
$labelColor = array('label-warning', 'label-info', 'label-danger', 'label-success');
$allDestinationTours = $houseDetails->destination->allDestinationTours($houseDetails->town_id);
$allUnits = Units::published()->where('jos_estateagent_object_id', $houseDetails->id)->with('unitPrice')->orderBy('redoslijed')->get();
return view('accommodation.show-house', compact('houseDetails', 'houseMainImage', 'houseImages', 'parentDestinationName', 'destinationName', 'description', 'meta_title', 'meta_description_all', 'apartments', 'rooms', 'houses', 'countpersons', 'allUnits', 'ownerTours', 'getCategoryLinks', 'getLinks', 'titleLang', 'linkLang', 'categoryTitleLang', 'labelColor', 'allDestinationTours'));
}
示例4: show
public function show($slugParent, $slug)
{
$destinationDetails = Destinations::where('alias', $slug)->first();
$id = $destinationDetails->jos_estateagent_town_id;
$title = getTranslate($id, 'jos_estateagent_town', 'title', Lang::locale())->value;
if ($destinationDetails->subtitle != NULL) {
$subtitle = getTranslate($id, 'jos_estateagent_town', 'subtitle', Lang::locale())->value;
}
$description = getTranslate($id, 'jos_estateagent_town', 'description', Lang::locale())->value;
$meta_title = getTranslate($id, 'jos_estateagent_town', 'meta_title', Lang::locale())->value;
$meta_description = getTranslate($id, 'jos_estateagent_town', 'meta_description', Lang::locale())->value;
$meta_keywords = getTranslate($id, 'jos_estateagent_town', 'meta_keywords', Lang::locale())->value;
$getCategoryLinks = Destinations::find($id)->DestinationCategoryLinks;
$categoryTitleLang = "jos_estateagent_town_category_links_" . Lang::locale();
$getLinks = Destinations::find($id)->DestinationLinks->where('jos_estateagent_town_links_publish', 1);
$titleLang = "jos_estateagent_town_links_title_" . Lang::locale();
$linkLang = "jos_estateagent_town_links_url_" . Lang::locale();
$labelColor = array('label-warning', 'label-info', 'label-danger', 'label-success');
$destinationMainImage = $destinationDetails->getMainDestinationImage($id);
$destinationImages = Destinations::find($id)->DestinationImages;
$countTours = $destinationDetails->countAllDestinationTours($id);
$travelGuideCategories = TourSubCategories::where('TOUR_CATEGORY', Config::get('constants.TRAVEL_GUIDE_ID'))->where('tour_subcategory_published', 1)->orderBy('tour_subcategory_order')->get();
return view('destinations.show', compact('travelGuideCategories', 'destinationDetails', 'title', 'subtitle', 'description', 'meta_title', 'meta_description', 'meta_keywords', 'getLinks', 'titleLang', 'linkLang', 'getCategoryLinks', 'categoryTitleLang', 'destinationMainImage', 'destinationImages', 'countTours', 'labelColor'));
}
示例5: getHouseTitleName
public function getHouseTitleName($title)
{
$cat = DB::table('jos_estateagent_house_title')->where('jos_estateagent_house_title_id', $title)->first();
$catName = getTranslate($cat->jos_estateagent_house_title_id, 'jos_estateagent_house_title', 'title', Lang::locale())->value;
return $catName;
}
示例6: show
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function show($houseSlug, $id)
{
$unitDetails = Units::where('id', $id)->first();
if ($unitDetails->house->destination->parent == 0) {
$destinationName = getTranslate($unitDetails->house->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
$parentDestinationName = "";
} else {
$destinationName = getTranslate($unitDetails->house->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
$parentDestinationName = getTranslate($unitDetails->house->destination->parent, 'jos_estateagent_town', 'title', Lang::locale())->value;
}
$title = $unitDetails->title;
$meta_title = $unitDetails->house->getHouseTitleName($unitDetails->house->jos_estateagent_house_title_id) . ' ' . $unitDetails->house->name;
if ($parentDestinationName != '') {
$meta_title .= ' | ' . $parentDestinationName;
}
$meta_title .= ' | ' . $destinationName . ' | ' . $unitDetails->getUnitCategoryName($unitDetails->cat) . ' ' . $unitDetails->title;
$meta_description = Lang::get('lang.MetaDescriptionPrivateURL');
if (getTranslate($unitDetails->id, 'jos_estateagent_unit', 'description', Lang::locale())->value != '') {
$meta_description .= getTranslate($unitDetails->id, 'jos_estateagent_unit', 'description', Lang::locale())->value;
} else {
if (getTranslate($unitDetails->house->id, 'jos_estateagent_house', 'description', Lang::locale())->value != '') {
$meta_description .= getTranslate($unitDetails->house->id, 'jos_estateagent_house', 'description', Lang::locale())->value;
} else {
$meta_description .= getTranslate($unitDetails->house->town_id, 'jos_estateagent_town', 'description', Lang::locale())->value;
}
}
$meta_description_all = strip_tags(shorttext($meta_description, 120));
$description = getTranslate($unitDetails->id, 'jos_estateagent_unit', 'description', Lang::locale())->value;
$isHotel = FALSE;
if ($unitDetails->house->jos_estateagent_main_categories_id == Config::get('constants.MAIN_HOUSE_CATEGORIES.HOTEL')) {
$isHotel = TRUE;
} else {
$isHotel = FALSE;
}
$add_services = array();
array_push($add_services, array(0 => "fullboard", 1 => "fullboard_payment", 2 => "Fullboard", 3 => "fullboard_price", 4 => "PerService"));
array_push($add_services, array(0 => "halfboard", 1 => "halfoard_payment", 2 => "Halfboard", 3 => "halfboard_price", 4 => "PerService"));
array_push($add_services, array(0 => "bed_breakfast", 1 => "bed_breakfast_payment", 2 => "BedBreakfast", 3 => "bed_breakfast_price", 4 => "PerService"));
array_push($add_services, array(0 => "dslinclude", 1 => "dsl_payment", 2 => "DSLInternet", 3 => "dslprice", 4 => "PerDay"));
array_push($add_services, array(0 => "petsinclude", 1 => "pets_payment", 2 => "Pets", 3 => "petsprice", 4 => "PerDay"));
array_push($add_services, array(0 => "parkinginclude", 1 => "park_payment", 2 => "ParkingPlace", 3 => "parkingprice", 4 => "PerDay"));
array_push($add_services, array(0 => "airinclude", 1 => "aircondition_payment", 2 => "IconAirCondition", 3 => "airprice", 4 => "PerDay"));
$negotiableCounterUnit = 0;
$negotiableStringsUnit = array();
$priceCounterUnit = 0;
$priceStringsUnit = array();
$pricesUnit = array();
$pricesPerUnit = array();
foreach ($add_services as $idList) {
if ($unitDetails->{$idList}[0] == 2 && $unitDetails->{$idList}[1] == 1) {
$negotiableCounterUnit++;
$negotiableStringsUnit[] = Lang::get('lang.' . $idList[2]);
} elseif ($unitDetails->{$idList}[0] == 2 && $unitDetails->{$idList}[1] == 0) {
$priceCounterUnit++;
$priceStringsUnit[] = Lang::get('lang.' . $idList[2]);
$pricesUnit[] = $unitDetails->{$idList}[3];
$pricesPerUnit[] = $idList[4];
}
}
$add_services_house = array();
array_push($add_services_house, array(0 => "cleaninginclude", 1 => "cleaning_negotiable", 2 => "FinalCleaning", 3 => "cleaningprice", 4 => "PerService"));
array_push($add_services_house, array(0 => "towels", 1 => "towel_negotiable", 2 => "Towels", 3 => "towelsprice", 4 => "PerService"));
array_push($add_services_house, array(0 => "berth", 1 => "berthprice_negotiable", 2 => "BerthUse", 3 => "berthprice", 4 => "PerDay"));
array_push($add_services_house, array(0 => "boat", 1 => "boat_negotiable", 2 => "BoatUse", 3 => "boatprice", 4 => "PerDay"));
$negotiableCounter = 0;
$negotiableStrings = array();
$priceCounter = 0;
$priceStrings = array();
$prices = array();
$pricesPer = array();
foreach ($add_services_house as $idList) {
if ($unitDetails->house->{$idList}[0] == 2 && $unitDetails->house->{$idList}[1] == 1) {
$negotiableCounter++;
$negotiableStrings[] = Lang::get('lang.' . $idList[2]);
} elseif ($unitDetails->house->{$idList}[0] == 2 && $unitDetails->house->{$idList}[1] == 0) {
$priceCounter++;
$priceStrings[] = Lang::get('lang.' . $idList[2]);
$prices[] = $unitDetails->house->{$idList}[3];
$pricesPer[] = $idList[4];
}
}
$unitMainImage = $unitDetails->getMainUnitImage($unitDetails->id);
$unitImages = Units::find($id)->UnitImages;
return view('accommodation.show', compact('unitDetails', 'unitMainImage', 'unitImages', 'parentDestinationName', 'destinationName', 'description', 'meta_title', 'meta_description_all', 'isHotel', 'negotiableCounterUnit', 'negotiableStringsUnit', 'priceCounterUnit', 'priceStringsUnit', 'pricesUnit', 'pricesPerUnit', 'negotiableCounter', 'negotiableStrings', 'priceCounter', 'priceStrings', 'prices', 'pricesPer'));
//
}
示例7: getFullDestination
public function getFullDestination($town_id)
{
$parentDestination = "";
$destination = "";
$findRow = Destinations::find($town_id);
$findParent = $findRow->parent;
if ($findParent == 0) {
$parentDestination = "";
$destination = getTranslate($town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
} else {
$findParentRow = Destinations::find($findParent);
$parentDestination = getTranslate($findParentRow, 'jos_estateagent_town', 'title', Lang::locale())->value;
$destination = getTranslate($town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
}
return array($parentDestination, $destination);
}
示例8: show
public function show($tourSlug, $tour_code)
{
$tourDetails = Tours::where('tour_code', $tour_code)->first();
$id = $tourDetails->TOUR_ID;
list($category_ID, $tourCategory, $tourSubCategory) = $tourDetails->getTourCategory($tourDetails->TOUR_SUBCATEGORY);
if ($tourDetails->town_id == $tourDetails->parent_town_id) {
$destinationName = getTranslate($tourDetails->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
$parentDestinationName = "";
} else {
$destinationName = getTranslate($tourDetails->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
$parentDestinationName = getTranslate($tourDetails->parent_town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
}
$title = getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_title', Lang::locale())->value;
$meta_title = getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'meta_title', Lang::locale())->value;
$meta_description1 = getTranslate($tourDetails->parent_town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
$meta_description1 .= ", " . getTranslate($tourDetails->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
$meta_description1 .= ", " . Lang::get('lang.MetaTitleForDestinations');
$meta_description1 .= ", " . getTranslate($category_ID, 'jos_estateagent_tour_category', 'tour_category_title', Lang::locale())->value;
$meta_description1 .= ", " . getTranslate($tourDetails->TOUR_SUBCATEGORY, 'jos_estateagent_tour_subcategory', 'tour_subcategory_title', Lang::locale())->value;
$meta_description1 .= ", " . getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_description', Lang::locale())->value;
$meta_description2 = "";
if (getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_description', Lang::locale())->value != '') {
$strings2 = getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_description', Lang::locale())->value;
$meta_description2 = strip_tags($strings2);
}
$meta_description = strip_tags(shorttext($meta_description1 . $meta_description2, 180));
$meta_keywords = Lang::get('lang.MetaKeywords');
$description = getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_description', Lang::locale())->value;
$profileDescription = getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_profile_description', Lang::locale())->value;
$prvi_datum = "";
$drugi_datum = "";
$event_time = "";
$time = "";
$event_time_end = "";
if ($tourDetails->is_event == 1) {
if ($tourDetails->tour_date != '0000-00-00') {
$timestampEventDate = strtotime($tourDetails->tour_date);
$prvi_datum = " " . date("d.m.Y", $timestampEventDate) . " ";
if ($tourDetails->tour_date_end == '0000-00-00') {
$drugi_datum = " ";
} elseif ($tourDetails->tour_date_end != '0000-00-00') {
$timestampEventDate = strtotime($tourDetails->tour_date_end);
$drugi_datum = "- " . date("d.m.Y", $timestampEventDate) . " ";
}
}
if ($tourDetails->tour_time != '00:00:00') {
$event_time = date('H:i', strtotime($tourDetails->tour_time)) . " " . Lang::get('lang.EventHours') . " ";
$time = Lang::get('lang.EventTime');
if ($tourDetails->tour_time_end != '00:00:00') {
$event_time_end = " - " . date('H:i', strtotime($tourDetails->tour_time_end)) . " " . Lang::get('lang.EventHours');
} else {
$event_time_end = ' ';
}
} else {
$event_time = ' ';
$time = "";
$event_time_end = ' ';
}
}
$duration_sintax = '';
if ($tourDetails->tour_duration != "0" && $tourDetails->tour_duration_unit != "0") {
if ($tourDetails->tour_duration == 1) {
$duration_sintax = Lang::get('lang.Tour' . substr_replace($tourDetails->tour_duration_unit, "", -1));
} elseif ($tourDetails->tour_duration > 1) {
$duration_sintax = Lang::get('lang.Tour' . $tourDetails->tour_duration_unit);
} else {
$duration_sintax = '';
}
}
$languageString = '';
if ($tourDetails->croatian == '1') {
$languageString .= Lang::get('lang.Croatian') . ', ';
}
if ($tourDetails->english == '1') {
$languageString .= Lang::get('lang.English') . ', ';
}
if ($tourDetails->german == '1') {
$languageString .= Lang::get('lang.German') . ', ';
}
if ($tourDetails->italian == '1') {
$languageString .= Lang::get('lang.Italian') . ', ';
}
if ($tourDetails->french == '1') {
$languageString .= Lang::get('lang.French') . ', ';
}
if ($tourDetails->slovenski == '1') {
$languageString .= Lang::get('lang.Slovenian') . ', ';
}
if ($tourDetails->ruski == '1') {
$languageString .= Lang::get('lang.Russian') . ', ';
}
if ($tourDetails->spanjolski == '1') {
$languageString .= Lang::get('lang.Spanish') . ', ';
}
if ($tourDetails->portugalski == '1') {
$languageString .= Lang::get('lang.Portuguese') . ', ';
}
if ($tourDetails->madjarski == '1') {
$languageString .= Lang::get('lang.Hungarian') . ', ';
}
//.........这里部分代码省略.........
示例9: rss
public function rss()
{
// create new feed
$feed = App::make("feed");
// cache the feed for 60 minutes (second parameter is optional)
$feed->setCache(30, 'laravelFeedKey');
// check if there is cached feed and build new only if is not
if (!$feed->isCached()) {
// creating rss feed with our most recent 20 posts
$products = Model_Main::getProducts(FALSE, ['title', 'description', 'meta_description', 'images'], FALSE, 0, 20);
$products_copy = $products;
$pubdate = reset($products_copy);
$pubdate = isset($pubdate['created_at']) ? $pubdate['created_at'] : date('Y.m.d H:i:s');
unset($products_copy);
// set your feed's title, description, link, pubdate and language
$feed->title = $this->system['title'];
$feed->description = $this->system['meta_description'];
$feed->logo = url('/images/logo.png');
$feed->link = url('rss');
$feed->setDateFormat('datetime');
// 'datetime', 'timestamp' or 'carbon'
$feed->pubdate = $pubdate;
//$posts[0]->created_at;
$feed->lang = Lang::locale();
$feed->setShortening(true);
// true or false
$feed->setTextLimit(255);
// maximum length of description text
$feed->ctype = "text/xml";
$public_path = Config::get('system_settings.product_public_path');
$full_size = Config::get('images.full_size');
// Loop trough products
foreach ($products as $key => $product) {
$product['meta_description'] = isset($product['meta_description']) ? $product['meta_description'] : '';
$product['description'] = isset($product['description']) ? strip_tags($product['description']) : '';
$product['description'] = trim(preg_replace('/\\s\\s+/', ' ', $product['description']));
//Fetch images
if (!empty($product['images']) && is_array(json_decode($product['images'], TRUE))) {
$products[$key]['images'] = json_decode($product['images'], TRUE);
//Order images
uasort($products[$key]['images'], function ($a, $b) {
if ($a == $b) {
return 0;
}
return $a < $b ? -1 : 1;
});
$enclosure = [];
//Add to feed
foreach ($products[$key]['images'] as $image => $position) {
$enclosure[] = ['url' => url($public_path . $product['id'] . '/' . $full_size . '/' . $image), 'type' => 'image/jpeg'];
}
}
$enclosure = reset($enclosure);
// set item's title, author, url, pubdate, description, content, enclosure (optional)*
$feed->add($product['title'], $this->system['title'], URL::to('/' . $product['slug']), $product['created_at'], $product['meta_description'], $product['description'], $enclosure);
}
}
// first param is the feed format
// optional: second param is cache duration (value of 0 turns off caching)
// optional: you can set custom cache key with 3rd param as string
return $feed->render('rss', 1, 'laravelFeedKey');
}
示例10: getToursSearchMeta
public function getToursSearchMeta($category, $subcategory, $destination)
{
$search_meta_title = '';
$search_meta_description = '';
$destination_meta_title = '';
$type_meta_title = '';
$category_meta_title = '';
if (isset($category) && $category > 0 && self::checkCategoryExist($category) > 0) {
$category_meta_title = getTranslate($category, 'jos_estateagent_tour_category', 'tour_category_title', Lang::locale())->value;
} else {
$category_meta_title = '';
}
if (isset($subcategory) && $subcategory > 0 && self::checkSubCategoryExist($subcategory) > 0) {
$type_meta_title = getTranslate($subcategory, 'jos_estateagent_tour_subcategory', 'tour_subcategory_title', Lang::locale())->value;
} else {
$type_meta_title = '';
}
if (isset($destination) && $destination > 0 && self::checkDestinationExist($destination) > 0) {
$parent_FeaturedDestinationName2 = getTranslate($destination, 'jos_estateagent_town', 'title', Lang::locale())->value;
} elseif (!isset($destination) || $destination == 0) {
$parent_FeaturedDestinationName2 = '';
$getdestination = '';
}
if ((!isset($destination) || $destination == 0) && (!isset($subcategory) || $subcategory == 0) && (!isset($category) || $category == 0)) {
$search_meta_title = Lang::get('lang.SearchMetaTitle');
$search_meta_description = Lang::get('lang.MetaDescriptionTours');
}
if ((!isset($destination) || $destination == 0) && (!isset($subcategory) || $subcategory == 0) && (isset($category) && $category > 0)) {
$search_meta_title = Lang::get('lang.MetaTitleForDestinations') . ' | ' . $category_meta_title;
$search_meta_description = Lang::get('lang.TitleIslandHvarCroatia') . '. ' . $category_meta_title . '. ' . Lang::get('lang.ToursAndActivities') . '. ' . Lang::get('lang.MetaSmallToursEnjoy');
}
if ((!isset($destination) || $destination == 0) && (isset($subcategory) && $subcategory > 0) && (isset($category) && $category > 0)) {
$search_meta_title = Lang::get('lang.MetaTitleForDestinations') . ' | ' . $category_meta_title . ' | ' . $type_meta_title;
$search_meta_description = Lang::get('lang.TitleIslandHvarCroatia') . '. ' . $category_meta_title . ', ' . $type_meta_title . '. ' . Lang::get('lang.ToursAndActivities') . '. ' . Lang::get('lang.MetaSmallToursEnjoy');
}
if ((!isset($destination) || $destination == 0) && (isset($subcategory) && $subcategory > 0) && (!isset($category) || $category == 0)) {
$search_meta_title = Lang::get('lang.MetaTitleForDestinations') . ' | ' . $category_meta_title . ' | ' . $type_meta_title;
$search_meta_description = Lang::get('lang.TitleIslandHvarCroatia') . '. ' . $category_meta_title . ', ' . $type_meta_title . '. ' . Lang::get('lang.ToursAndActivities') . '. ' . Lang::get('lang.MetaSmallToursEnjoy');
}
if (isset($destination) && $destination > 0 && (!isset($subcategory) || $subcategory == 0) && (!isset($category) || $category == 0)) {
$search_meta_title = $parent_FeaturedDestinationName2 . ', ' . Lang::get('lang.MetaTitleForDestinations') . ' | ' . Lang::get('lang.MetaSmallTours');
$search_meta_description = $parent_FeaturedDestinationName2 . ', ' . Lang::get('lang.MetaTitleForDestinations') . '. ' . Lang::get('lang.WhereToGo') . ' ' . Lang::get('lang.WhatToDo') . ' ' . Lang::get('lang.WhatToSee') . ' ' . Lang::get('lang.MetaSmallToursEnjoy');
}
if (isset($destination) && $destination > 0 && (!isset($subcategory) || $subcategory == 0) && (isset($category) && $category > 0)) {
$search_meta_title = $parent_FeaturedDestinationName2 . ', ' . Lang::get('lang.MetaTitleForDestinations') . ' | ' . $category_meta_title;
$search_meta_description = $parent_FeaturedDestinationName2 . ', ' . Lang::get('lang.TitleIslandHvarCroatia') . '. ' . $category_meta_title . '. ' . Lang::get('lang.ToursAndActivities') . '. ' . Lang::get('lang.MetaSmallToursEnjoy');
}
if (isset($destination) && $destination > 0 && (isset($subcategory) && $subcategory > 0) && (isset($category) && $subcategory > 0)) {
$search_meta_title = $parent_FeaturedDestinationName2 . ', ' . Lang::get('lang.MetaTitleForDestinations') . ' | ' . $category_meta_title . ' | ' . $type_meta_title;
$search_meta_description = $parent_FeaturedDestinationName2 . ', ' . Lang::get('lang.TitleIslandHvarCroatia') . '. ' . $category_meta_title . ', ' . $type_meta_title . '. ' . Lang::get('lang.ToursAndActivities') . '. ' . Lang::get('lang.MetaSmallToursEnjoy');
}
return array($search_meta_title, $search_meta_description);
}
示例11: getUnitsSearchMeta
public function getUnitsSearchMeta($destination, $acc_type, $cat)
{
$search_meta_title = '';
$search_meta_description = '';
$getDestination = "";
$getType = "";
$getCat = "";
$getAllCombined = [];
if ($destination != "") {
switch ($destination) {
case $destination > 0:
$getDestination = getTranslate($destination, 'jos_estateagent_town', 'title', Lang::locale())->value;
break;
case $destination == 0:
$getDestination = "";
break;
default:
$getDestination = "";
}
}
if ($acc_type != "") {
switch ($acc_type) {
case $acc_type > 0:
$getType = getTranslate($acc_type, 'jos_estateagent_categories', 'plural', Lang::locale())->value;
break;
case $acc_type == 0:
$getType = "";
break;
default:
$getType = "";
}
}
if ($cat != "") {
switch ($cat) {
case $cat > 0:
$getCat = getTranslate($cat, 'jos_estateagent_house_category', 'title', Lang::locale())->value;
break;
case $cat == 0:
$getCat = "";
break;
default:
$getCat = "";
}
}
$getAllCombined[] = array("Destination" => $getDestination, "AccType" => $getType);
if ($getDestination != "" && $getType != "") {
$search_meta_title = $getDestination . ' ' . $getType . ' | ' . Lang::get('lang.TitleAccommodation') . ' ' . Lang::get('lang.TitleIslandHvarCroatia');
$search_meta_description = $getDestination . ', ' . Lang::get('lang.DescriptionDestinations') . ' ' . $getType . ' - ' . Lang::get('lang.TitleIslandHvarCroatia');
} elseif ($getDestination != "" && $getType == "") {
$search_meta_title = $getDestination . ' | ' . Lang::get('lang.TitleAccommodation') . ' ' . Lang::get('lang.TitleIslandHvarCroatia');
$search_meta_description = $getDestination . ', ' . Lang::get('lang.DescriptionDestinations') . ' - ' . Lang::get('lang.TitleIslandHvarCroatia');
} elseif ($getDestination == "" && $getType != "") {
$search_meta_title = Lang::get('lang.TitleFindAccommodation') . ' | ' . $getType . ' ' . Lang::get('lang.TitleIslandHvarCroatia');
$search_meta_description = Lang::get('lang.DescriptionOnlyAccommodation') . ' ' . $getType . ' - ' . Lang::get('lang.TitleIslandHvarCroatia');
} elseif ($getDestination == "" && $getType == "") {
$search_meta_title = Lang::get('lang.TitleFindAccommodation') . ' | ' . $getCat . ' ' . Lang::get('lang.TitleIslandHvarCroatia');
$search_meta_description = Lang::get('lang.DescriptionCategories') . ' ' . Lang::get('lang.TitleIslandHvarCroatia') . ' ' . $getCat;
} else {
$search_meta_title = Lang::get('lang.TitleIslandHvarCroatia') . ' | ' . Lang::get('lang.TitleFindAccommodation');
$search_meta_description = Lang::get('lang.DescriptionDestinations') . ' - ' . Lang::get('lang.TitleIslandHvarCroatia');
}
return array($search_meta_title, $search_meta_description);
}