ty0716 Posted July 13, 2015 Report Posted July 13, 2015 If i want to create a simple page view. Not need to show the "structure.pdt". How to do this? Another question is: $rs=$this->Record->select()->from("Clients"); Why above code show error:Undefined property: Main::$Record on if i want to get some get request value .for example : http://domain.com/clients/main/activity/month/7 How to get the value of month? Quote
0 Tyson Posted July 13, 2015 Report Posted July 13, 2015 If i want to create a simple page view. Not need to show the "structure.pdt". How to do this? The controller method should return boolean false. Another question is: $rs=$this->Record->select()->from("Clients"); Why above code show error:Undefined property: Main::$Record on Record has not been instantiated in Main. The Record object is only available automatically to models that extend AppModel. If you want to run a query from your controller, you should call a model that does it instead. if i want to get some get request value .for example : http://domain.com/clients/main/activity/month/7 How to get the value of month? Assuming "main" is your controller and "activity" is your method, then $month = $this->get[0]; // month $number = $this->get[1]; // 7 Quote
0 ty0716 Posted July 16, 2015 Author Report Posted July 16, 2015 The controller method should return boolean false. Record has not been instantiated in Main. The Record object is only available automatically to models that extend AppModel. If you want to run a query from your controller, you should call a model that does it instead. Assuming "main" is your controller and "activity" is your method, then $month = $this->get[0]; // month $number = $this->get[1]; // 7 why in plugins http://domain.com/client/plugin/support_managerpro/client_tickets/add/1/ var_dump($this->get) and var_dump($this->get[0]) show NULL? Quote
0 Tyson Posted July 17, 2015 Report Posted July 17, 2015 why in plugins http://domain.com/client/plugin/support_managerpro/client_tickets/add/1/ var_dump($this->get) and var_dump($this->get[0]) show NULL? You would have to show more of your code. I've never looked at the Support Manager PRO plugin, but your example URL suggests that $id = $this->get[0]; // 1 Quote
Question
ty0716
If i want to create a simple page view. Not need to show the "structure.pdt". How to do this?
Another question is:
Why above code show error:Undefined property: Main::$Record on
if i want to get some get request value .for example : http://domain.com/clients/main/activity/month/7
How to get the value of month?
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.