protected function BODY__SecondHelloWorldView()
 {
     parent::BODY();
     print "<h1>Welcome, to the second view.</h1>";
     print "<p><a href='?'>I'm done here, take me to the first view!</a></p>";
     print "<br /><br /><br />OR<br />";
     print "<p><a href='HelloWorld_03.php'>Continue to Example 03</a></p>";
 }
示例#2
0
文件: AdminPage.php 项目: zetas/nZEDb
 public function render()
 {
     $this->smarty->assign('page', $this);
     $admin_menu = $this->smarty->fetch('adminmenu.tpl');
     $this->smarty->assign('admin_menu', $admin_menu);
     $this->page_template = 'baseadminpage.tpl';
     parent::render();
 }
示例#3
0
    protected function BODY()
    {
        parent::BODY();
        ?>

			<h1>Hello World!!!</h1>

		<?php 
    }
示例#4
0
文件: Page.php 项目: ngdvan/lntguitar
 public function beforeSave()
 {
     if ($this->isNewRecord) {
         $this->create_time = $this->update_time = time();
         $this->user_id = Yii::app()->user->id;
     } else {
         $this->update_time = time();
     }
     return parent::beforeSave();
 }
示例#5
0
文件: Page.class.php 项目: Gula/magic
 public function save(Doctrine_Connection $conn = null)
 {
     $slug = Magic::slugify($this->getTitle());
     if ($this->isNew()) {
         $i = 0;
         do {
             $i++;
             $q = Doctrine::getTable('Page')->findOneBySlug($slug);
             if (!$q) {
                 break;
             } else {
                 $slug = Magic::slugify($this->getTitle());
                 $slug .= $i;
             }
         } while ($i);
         $this->setSlug($slug);
     } elseif ($slug != $this->getSlug()) {
         $i = 0;
         do {
             $i++;
             $q = Doctrine::getTable('Page')->findOneBySlug($slug);
             if (!$q) {
                 $this->setSlug($slug);
                 break;
             } else {
                 if ($slug == $this->getSlug()) {
                     break;
                 } else {
                     $slug = Magic::slugify($this->getTitle());
                     $slug .= $i;
                 }
             }
         } while ($i);
     }
     parent::save($conn);
     // generamos thumbnails
     $file = sfConfig::get('sf_upload_dir') . '/pictures/' . $this->getPicture();
     if (is_file($file)) {
         $dims = array(array('w' => 950, 'h' => 534), array('w' => 720, 'h' => 405), array('w' => 250, 'h' => 141), array('w' => 60, 'h' => 60));
         $size = getimagesize($file);
         $img = new sfImage($file, $size['mime']);
         if (!is_dir(sfConfig::get('sf_upload_dir') . '/' . $this->get('id'))) {
             mkdir(sfConfig::get('sf_upload_dir') . '/' . $this->get('id'), 0777);
         }
         foreach ($dims as $dim) {
             $img->thumbnail($dim['w'], $dim['h']);
             $img->setQuality(90);
             $img->saveAs(sfConfig::get('sf_upload_dir') . '/' . $this->get('id') . '/img_' . $this->get('id') . '_' . $dim['w'] . 'x' . $dim['h'] . '.jpg');
         }
     }
 }
示例#6
0
文件: Page.php 项目: kotow/work
 public function delete($con = null)
 {
     try {
         $con = Propel::getConnection();
         $con->begin();
         //deletes generic document
         $genericDocument = Document::getGenericDocument($this);
         $genericDocument->delete();
         parent::delete();
         Document::deleteObjCache($this);
         $con->commit();
         return true;
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
 }
    protected function BODY()
    {
        parent::BODY();
        ?>

<h1>Hello World 01!!!</h1>

<p>This is the first Hello World example with the addition of this
	message and using a public constructor, __construct().</p>
<p>
	Also notice that the classname has been changed to 'HelloWorld_01' to
	match the filename of 'HelloWorld_01.php'.<br />If you leave the class
	name as HelloWorld, you will get an error message at the top of your
	screen saying "Classname doesn't match file name".<br />I am also
	calling 'parent::BODY()' in the top of the BODY() function. This is a
	good habit to get into, as when you start using page template, that's
	where the header code will usually be.
</p>
<p>
	<a href='HelloWorld_02.php'>Continue to Example 02</a>
</p>
<?php 
    }
示例#8
0
 public function __construct()
 {
     parent::__construct();
 }
示例#9
0
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }
示例#10
0
 /**
  * Returns a peer instance associated with this om.
  *
  * Since Peer classes are not to have any instance attributes, this method returns the
  * same instance for all member of this class. The method could therefore
  * be static, but this would prevent one from overriding the behavior.
  *
  * @return PagePeer
  */
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new PagePeer();
     }
     return self::$peer;
 }
示例#11
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getBasePage()
 {
     return $this->hasOne(BasePage::className(), ['id' => 'base_page_id']);
 }
示例#12
0
 /**
  * Initializes internal state of Page object.
  * @see        parent::__construct()
  */
 public function __construct()
 {
     // Make sure that parent constructor is always invoked, since that
     // is where any default values for this object are set.
     parent::__construct();
 }
示例#13
0
文件: Page.php 项目: rapila/cms-base
 protected function moveSubtreeTo($destLeft, $levelDelta, PropelPDO $con = null)
 {
     $oOldParent = $this->getParent($con);
     $oNewParent = PageQuery::create()->filterByTreeLeft($destLeft, Criteria::LESS_THAN)->filterByTreeRight($destLeft, Criteria::GREATER_EQUAL)->filterByTreeLevel($this->getLevel() + $levelDelta - 1)->findOne();
     // Copied from denyable behavior
     if (!(PagePeer::isIgnoringRights() || $this->mayMoveFromTo($oOldParent, $oNewParent))) {
         throw new PropelException(new NotPermittedException("move.custom.pages", array("role_key" => "pages")));
     }
     return parent::moveSubtreeTo($destLeft, $levelDelta, $con);
 }
示例#14
0
 public function open($method = 'GET', $parameters = [])
 {
     parent::open($method, $parameters);
     return new AddRecipeStep($this->client, $this);
 }
示例#15
0
 public function open($method = 'DELETE', $parameters = [])
 {
     parent::open($method, $parameters);
     return new CreateRecipe($this->client, $this);
 }
示例#16
0
文件: Page.php 项目: Jay204/nZEDb
 public function render()
 {
     $this->smarty->assign('page', $this);
     $this->page_template = "basepage.tpl";
     parent::render();
 }
示例#17
0
文件: Page.php 项目: awecode/awecms
 public function init()
 {
     return parent::init();
 }
示例#18
0
 public function init()
 {
     parent::init();
 }