/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Programm the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Programm::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
/* * @Copyright Benjamin Knecht * Chatbot App which connect to a CSharp/C# Chat. */ // DEB error_reporting(E_ALL); require 'config.php'; require 'autoloader.php'; class Programm { /* * BaseClass Konstruktor */ function __construct() { } public function run() { $socket = new sockets(); $chatbot = new chatbot(); $socket->onOpen(IP, PORT); $chatbot->sendLogin($socket->socket, USERNAME, PASSWORD); $chatbot->joinChannel($socket->socket, CHANNEL); while (true) { $socket->onMessage(); //$chatbot->autotalk($socket->socket); // be carefully, the Bot goes crazy ;-) } } } $programm = new Programm(); $programm->run();
public function actionProgramm() { $page = Programm::model()->findByPk(1); $criteria = new CDbCriteria(); $criteria->group = 'id DESC'; $criteria->limit = 3; $criteria->condition = 'region_id = 12 OR region_id = 0'; $news = News::model()->findAll($criteria); $this->render('statutAndProgramm', array('page' => $page, 'news' => $news)); }