Tuesday, June 23, 2015

Yii 1.1 path

Yii::app()->getBaseUrl(true);   // => http://localhost/sample
Yii::app()->getHomeUrl();       // => /sample/index.php
Yii::app()->getBaseUrl(false);  // => /sample


Yii::app()->request->baseUrl // => /sample

Yii::app()->theme->baseUrl //=> sample/themes/bluetheme

Thursday, May 21, 2015

Composer Yii 2.0 update







































set the path to php.exe

A:\>
A:\>cd xampp
A:\xampp>cd php
A:\xampp\php>
A:\xampp\php>PATH="A:\xampp\php"


check the php version; should be greater than 5.4

A:\xampp\php>php -v
PHP 5.6.3 (cli) (built: Nov 12 2014 17:18:08)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies


i copied the composer files from C:\Users\jerome\AppData\Local\ComposerSetup\bin
composer, composer.bat, composer.phar
i think only phar file is needed, anyways copied all the files into xampp/php folder

A:\xampp\php>dir
 Volume in drive A is Data
 Volume Serial Number is C629-A5C0

 Directory of A:\xampp\php

05/17/2015  03:22 PM              .
05/17/2015  03:22 PM              ..
06/18/2013  02:04 PM              cfg
05/16/2015  10:18 PM               587 composer
10/16/2013  06:21 PM                38 composer.bat
05/16/2015  10:18 PM         1,103,875 composer.phar


follow the instructions from 
http://www.yiiframework.com/download/
--install the composer asset plugin

A:\xampp\php>php composer.phar global require "fxp/composer-asset-plugin:1.0.0"
Changed current directory to C:/Users/jlabs/AppData/Roaming/Composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files


install the project files

A:\xampp\php>php composer.phar create-project yiisoft/yii2-app-advanced ../htdocs/advanced 2.0.4
Installing yiisoft/yii2-app-advanced (2.0.4)
  - Installing yiisoft/yii2-app-advanced (2.0.4)
    Loading from cache

Created project in ../htdocs/advanced
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing yiisoft/yii2-composer (2.0.3)
    Loading from cache

  - Installing ezyang/htmlpurifier (v4.6.0)
    Loading from cache

  - Installing cebe/markdown (1.1.0)
    Loading from cache

  - Installing bower-asset/jquery (2.1.4)
    Loading from cache

  - Installing bower-asset/jquery.inputmask (3.1.63)
    Loading from cache

  - Installing bower-asset/punycode (v1.3.2)
    Loading from cache

  - Installing bower-asset/yii2-pjax (v2.0.4)
    Loading from cache

  - Installing yiisoft/yii2 (2.0.4)
    Loading from cache

  - Installing swiftmailer/swiftmailer (v5.4.0)
    Loading from cache

  - Installing yiisoft/yii2-swiftmailer (2.0.4)
    Loading from cache

  - Installing yiisoft/yii2-codeception (2.0.4)
    Loading from cache

  - Installing bower-asset/bootstrap (v3.3.4)
    Loading from cache

  - Installing yiisoft/yii2-bootstrap (2.0.4)
    Loading from cache

  - Installing yiisoft/yii2-debug (2.0.4)
    Loading from cache

  - Installing bower-asset/typeahead.js (v0.10.5)
    Loading from cache

  - Installing phpspec/php-diff (v1.0.2)
    Loading from cache

  - Installing yiisoft/yii2-gii (2.0.4)
    Loading from cache

  - Installing fzaninotto/faker (v1.4.0)
    Loading from cache

  - Installing yiisoft/yii2-faker (2.0.3)
    Loading from cache

Writing lock file
Generating autoload files





change the default jdk path in netbeans 8.0.2



















i have installed netbeans in
A:\Program Files\NetBeans 8.0.2\

go to
A:\Program Files\NetBeans 8.0.2\etc

edit
netbeans.conf

change line 57


netbeans_jdkhome="A:\Program Files\Java\jdk1.8.0_31"

netbeans_jdkhome="A:\Program Files\Java\jdk1.8.0_45"

Wednesday, May 13, 2015

Wednesday, April 15, 2015

Magento : Get Base Url , Skin Url , Media Url , Js Url , Store Url and Current Url

Get Url in phtml files

1. Get Base Url :

Mage::getBaseUrl();


2. Get Skin Url :

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);


(a) Unsecure Skin Url :

$this->getSkinUrl('images/imagename.jpg');


(b) Secure Skin Url :

$this->getSkinUrl('images/imagename.gif', array('_secure'=>true));


3. Get Media Url :

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);


4. Get Js Url :

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);


5. Get Store Url :

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);


6. Get Current Url

Mage::helper('core/url')->getCurrentUrl();




Get Url in cms pages or static blocks

1. Get Base Url :

{{store url=""}}


2. Get Skin Url :

{{skin url='images/imagename.jpg'}}


3. Get Media Url :

{{media url='/imagename.jpg'}}


4. Get Store Url :

{{store url='mypage.html'}}

About

Blogger templates