Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8386589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:58:56+00:00 2026-06-09T17:58:56+00:00

I came across a new syntax for a ternary operation in PHP. $this->view->totalNumber >

  • 0

I came across a new syntax for a ternary operation in PHP.

$this->view->totalNumber > $itemsPerPage ? $this->view->renderPaginator = true 
                                         : $this->view->renderPaginator = false;

Is this some sort of short-hand for only apply the ternary operation if the resulting value is greater than the existing value for the left side variable?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:58:58+00:00Added an answer on June 9, 2026 at 5:58 pm

    It’s just the comparison operation. You can rewrite it like this if it helps you understand:

    ($this->view->totalNumber > $itemsPerPage) ? $this->view->renderPaginator = true : $this->view->renderPaginator = false;
    

    Now a better way to write it would be simply to do:

    $this->view->renderPaginator = ($this->view->totalNumber > $itemsPerPage);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to PHP. I came across this syntax in WordPress . What does
Came across this code: <?php require_once 'HTTP/Session/Container/DB.php'; $s = new HTTP_Session_Container_DB('mysql://user:password@localhost/db'); ini_get('session.auto_start') or session_start();
Hi I am new in php and when I came across define('INCLUDE_CHECK',true); I was
I'm new to C programming and I just came across this program and got
So i'm new with mongodb and mapreduce in general and came across this "quirk"
I was analyzing Javascript codes and came across this line: var date = (new
While reading the web2py manual, I came across this following: 'Once a new user
Today I came across a new CSS syntax that I have never seen before
I am fairly new to F# and came up across this scenario and was
I came a across a new problem when using templates. This is me being

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.