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
Post a Comment