Welcome Guest, Not a member yet? Register   Sign In
controller without the controller?
#1

[eluser]soprabaixar1[/eluser]
I can not make a "flag " between the view and controller. I did several tests, for example, declare a variable just below the class declaration and then increment in method index(); of the controller.

Sending this variable ($data['x'] = $this->xWink to the view but can not exceed the value 1. This is always 0 or 1. This shows that have no proper control. How can I make the increment value ever? I tried the command $this->x++; and gave a "print $this->x;" in both the controller and the view.

The problem I'm having is larger than this, then simplified and did some testing to understand where he was wandering.
#2

[eluser]Ñuño Martínez[/eluser]
Hard to understand your post, but I think you forgot to <a href="http://www.php.net/manual/en/language.variables.scope.php">declare the external flag as global</a>.
#3

[eluser]JuanitoDelCielo[/eluser]
Code dude, we need it wot help you Tongue
#4

[eluser]InsiteFX[/eluser]
Static

InsiteFX
#5

[eluser]soprabaixar1[/eluser]
How do I know if it's the first time that the controller executed??
There are several methods in the controller, but need to know when it is first executed.
#6

[eluser]soprabaixar1[/eluser]
It would be like to use the "static".
The problem I'm having is when I use the pagination and go to next page. This is restarting some variables that should not.
I have been using global variable.
Code:
class Users extends Controller {

  var $status = 0;

  function ...
}




Theme © iAndrew 2016 - Forum software by © MyBB