Thursday, 3 March 2016

Dojo Interview Questions and Answers for Fresher

Dojo Interview Questions and Answers for Freshers

Question: What is Dojo?
It is JavaScript framework used for rapid development of cross-platform applications and web sites. Also known as Dojo Toolkit.


Question: What is current Stable release of Dojo?
1.10.4 / January 18, 2015


Question: In Which language, Its written?
JavaScript


Question: What is offical website of dojo?
http://dojotoolkit.org


Question: From where I can download dojo?
http://dojotoolkit.org/download/


Question: How to load dojo from CDN?
<script src="https://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js"></script>



Question: Is it opensource??
Yes, It is.


Question: What are different section/parts of Dojo library?
  1. dojo: Its core files.
  2. dijit: It have user-interface modules for widgets and layout
  3. dojox: It have assorted module
  4. util: It have tools like optimization, documentation, style-checking and testing.



Question: What are different Advantages of Dojo?
  1. Associative arrays
  2. Objects and classes
  3. Regular expression
  4. Loosely typed variables



Question: What are different Features of Dojo?
  1. Widgets
  2. Asynchronous communication
  3. Packaging system
  4. Client-side data storage
  5. Server-side data storage



Question: What is the basic structure in Dojo?
/index.html - The application entry point.
/app - The application module.
/app/main.js - The main script for app module.


Question: What is Widget Toolkit in Dojo?
Widget is a user interface object that has a layout and HTML+CSS bound by JavaScript. Dojo have widgets like Tabs, sorting table and dialogs etc.


Question: How to use Dojo Editor widget?
<script>
dojo.require("dojo.widget.textEditorId");
</script>
<textarea dojotype="textEditorId"> </textarea>



Question: Give some dojo components name?
  1. DOJO Tree
  2. DOJO Button
  3. DOJO Grid
  4. DOJO List box
  5. DOJO Calendar



Question: What is difference between DOJO and jQuery?
DOJO jQuery
JavaScript toolkit or framework JavaScript library
HTML and JavaScript based tool kit supports almost all web languages
Dojo requires higher network bandwidth Works good in low network bandwidth
Good for bigger website and application Good for small application.



Wednesday, 2 March 2016

How to use view helper in zend framework?

How to use view helper in zend framework?

Question: What is zend view helper?
View Helpers are common file(s) which is available in every view file.
Most of the time we kept helpers file in views/helpers/

Following the simple following steps to use view helper.
  1. Open configs\application.ini, Add Following line
    resources.view.helperPath.Application_View_Helper = APPLICATION_PATH "/views/helpers"
  2. Create General.php file in application\views\helpers (Might be need to create helpers folder)
  3. Add Following code in General.php
    class Zend_View_Helper_General extends Zend_View_Helper_Abstract {
        function General(){
            return $this;
        }
         function twice($a)
        {
            return $a * 2;
        }
        
        function thrice($a)
        {
            return $a * 3;
        }    
    }
  4. Test Following in any view files
    echo  $this->General()->twice(2);//4
    echo  $this->General()->thrice(2);//6
    echo  $this->General()->twice(3);//6
    echo  $this->General()->thrice(3);//9
    
  5. Done


If above is not working in other modules like admin, then copy/paste following function in Bootstrap.php

 protected function _initViewHelpers() {
        $this->bootstrap('layout');
        $layout = $this->getResource("layout");
        $view = $layout->getView();
        $view->addHelperPath(APPLICATION_PATH . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'helpers', "Application_View_Helper");
    }