Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class PasteController extends AppController{
- var $name = "Paste";
- var $uses = array("SourceCode");
- var $components = array('KindSyntaxComp');
- var $layout = 'default';
- //var $helpers = array('');
- function index(){
- //$IDGenerator= new IDGenerator();
- //echo $IDGenerator->getNextId();
- $this->render('paste_source');
- }
- function view(){
- if(empty($this->data['SourceCode']['source_code'])){
- $this->redirect('index');
- }
- if(!empty($this->data)){
- $this->data['SourceCode']['paste_date']=date('Y-m-d H:i:s');
- $this->SourceCode->save($this->data);
- $this->KindSyntaxComp->STX($this->data['SourceCode']['lang_type']);
- $code=$this->KindSyntaxComp->stx_string($this->data['SourceCode']['source_code']);
- $this->set('code',$code);
- $this->render('view_source');
- }
- }
- }
- ?>
Add Comment
Please, Sign In to add comment