Witam,
proszę o opinie na temat:
1. strony www
2. frameworka
Co byście zmienili, czego wam brakuje.
Adres: http://spawnframework.com/
class sf_url{ /** *return controller and action * *@param - string - core - if true - return base spawn config *@return - string - /{controller}/{action} */ if($core==true){ $par=sf_config::get('spawn'); return '/'.$par['controller'].'/'.$par['action']; } return '/'.sf_request::instance()->param(0).'/'.sf_request::instance()->param(1); }
class sf_date{ /** *add X day to date * *@param - string - date *@param - string - day *@return - string - new date */ return $dateTo; }
$view=sf_view('home'); $view->title='aaa'; $view->main=sf_view::factory('news')->helper('form')->render(); $view->render();
class sf_orm { return $this->_db->update($this->_tableName , $values,$where , $sep ); } //valid values if($this->_structure){ foreach($req as $key => $val){ } } } //create where //execute return $this->_db->update($this->_tableName,$req, $where, $sep); } }
class sf_orm { $where = $this->createWhere($where); return $this->doUpdate($values, $where, $sep); } private function createWhere($where){ } return $where; } private function doUpdate($values, $where, $sep){ return $this->_db->update($this->_tableName, $values, $where, $sep); } $values = $this->deleteUnusedValues($req); return $this->update($values, $where, $sep); } if($this->_structure){ $values = array_intersect_key($values, $this->_structure); } return $values; } }
nazwa() { //coś }
/** *get cookie param * *@param - string - param name *@param - if cookie with self param not exists return this param *@return - string */ }
'x' => 17, 'y' => 29 ); $bool = false; if (warunek) { //kod } switch (warunek) { case 'a': //kod break; } class example { public function a() { //kod } }
public function checkbox($name,$value,$check=false,$css=''){ $check=($check==false)? '' : ' checked '; return '<input type="checkbox" name="'.$name.'" value="'.$value.'" '.$css.' '.$check.' />'; }
public function indexAction(){ $view=new sf_view('spawn'); // forwarding $controller = new sf_controller; $view->render(false); } public function infoAction(){ return 'info'; }
/** *use sf_html::pre to write $val * *@param - array - param to write */ public function pre($val){ sf_html::pre($val); }