File name : controllers/sample.php // controllers/sample/sample.php..
Class name : SampleController
class VmController extends Controller {
}
class VmController extends Controller {
function __construct($namespace){
parent::__construct($namespace) ;
}
function f1 (){
$cookie['name']='THULE';
$cookie['value']='THULE1234';
$this->loadHelper("auth");
$c=$this->auth->get_cookie($cookie);
//$this->auth->del_cookie($cookie);
// validator
$this->loadHelper("validation");
$arr_sql['member_id']=1;
var_dump($this->Validation->is_numeric($arr_sql['member_id']));
$hconn=&$this->opendb('default');
$this->loadModel('sample',$hconn);
$this->Sample->update_member($arr_sql);
$result=$this->Sample->select_member($arr_sql);
foreach($result[0] as $var=>$value) {
$this->setResponse($var,$value);
}
$this->loadController("mvc","MVC");
$this->MVC->f1();
$this->view->test="test";
return $sql;
}
function f2 (){
var_dump($this->_request);
$hconn=$this->opendb('default');
var_dump($hconn);
$this->closedb($hconn);
return "F2";
}
}
$hconn=$this->opendb('default');
$this->loadModel("sample",$hconn);
$this->Sample->update_member($arr_sql);
$result=$this->Sample->select_member($arr_sql);
foreach($result[0] as $var=>$value) {
$this->setResponse($var,$value);
}
$this->loadController("mvc","MVC");
$this->MVC->f1();
$this->loadController(array("mvc","vm",,));
$this->Mvc->f1();
$this->Vm->f1();
$this->redirect("http://www.thuleframework.com");
$this->getRequest(); // all request
$this->getRequest('property');
$this->loadHelper("login","Login"); // first parameter is helper class ,second is call name.
$this->Login->islogin($hconn,$this->auth,1);
$this->loadHelper(array("login","json","paging",,));
$this->Login->f1();
$this->Json->f1();
$this->Paging->f1();
......
$this->loadModel("sample",$hconn,"Sample");
$this->Sample->sample_select($arrSql);
$this->loadModel(array("sample","sample1","sample2",,),$hconn);
$this->Sample->f1();
$this->Sample1->f1();
$this->Sample2->f1();
......
if($this->isReserved(__METHOD__)) return false;
This feature can allow you can determine the view will be called or not.
render the view
$this->render();
no render the view
$this->norender();
This functino can check the POST you can use when you get the form value or not.
if( $this->isPost() ) {
// when post
}