php - Condition if request named parameter has this value in CakePHP -


I was trying to make a condition that would be a special SQL query condition if the named name is inactive request is inactive.

  if named (isset- ($- >--> condition-> ['status: inactive'])) {$ conditions ["ApplicationCode.status"] = 'inactive';   

Pagination part, which is the condition variable btw:

  $ this-> paginate = array ('order '= & gt; Array (' ApplicationCode.code '= & gt;' ASC '),' conditions '= & gt; $ terms,' range '=> 50,' contain '= & gt; array (' Role ',' app '= & gt; array (' conditions' = & gt; array ('application.state! =' = & Gt; application: archival), 'user')));   

I'm too new to PHP and I'm using the KPHP framework.

The above code does not work. If I delete : inactive , it is working

thanks in advance.

  if (isset ($ this-> request-> gt; Status'])) {$ conditions ["ApplicationCode.status"] = $ this- & gt; Request-> Nominated ['status]; }   

or

  if (isset ($ -in-- >-> ['condition']]; & amp; amp; $ $ This-> Request-> Named ['status'] == 'Inactive') {$ conditions ["ApplicationCode.status"] = 'Inactive'; }    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -