Jump to content
Дизайн и модификация IPS Community IPBSkinsBETA
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
TemKa_SD

Undefined index в widget configuration

Recommended Posts

Здравствуйте, чем оно отличается от этого?

 

isset( $realms[ $realm['realm'] ] ) ? $realms[ $realm['realm'] ]++ : $realms[ $realm['realm'] ] = 1;

Share this post


Link to post
Share on other sites

В седьмой версии появился оператор объединение с null - ??.

Удобный оператор в случаях когда переменная не объявлена и надо использовать функция isset, заметно сокращает код.

 

$ids = explode( ',', isset( $groups[ $id ] ) ? $groups[ $id ] : '' );

Объединение с null

 

$ids = explode( ',', $groups[ $id ] ?? '' );

 

 

if( !isset( $groups[ $id ] ) OR $groups[ $id ] != 2 )

Объединение с null

 

if( ( $settings[ $id ] ?? '' ) != 2 )

 

 

$games = \IPS\wc3\ActiveGames\ActiveGames::getGamelist(isset($this->configuration['ActiveGamesWidgetType']) ? $this->configuration['ActiveGamesWidgetType'] : '');

Объединение с null

 

$games = \IPS\wc3\ActiveGames\ActiveGames::getGamelist($this->configuration['ActiveGamesWidgetType'] ?? '');

  • Upvote 1

Share this post


Link to post
Share on other sites

Спасибо, сейчас проснусь - ознакомлюсь )

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...