Archive

Archive for the ‘cakePhp’ Category

apach configuration

January 22, 2015 Leave a comment
Categories: apache, aws, cakePhp, linux, php, Web

mailto using javascript

February 21, 2011 Leave a comment

some time it is required to set mailto using javascript.

let us write a JavaScript function this.

<script type=”text/javascript”>

function sendmail() { var user=”apps”; var domain=”mydomainame.com”;      document.location=”mailto:”+user+”@”+domain;     }

</script>

now you can call this function using any event or method lets suppose we use onclick event of an div.

<div id=”click-me” name=”click-me” onclick=”sendmail()”>click me </div>

Voila, it opened my outlook.

Array to String Conversion using php

January 21, 2011 1 comment

it normally happen you are convert  some delimited string to array and php do it as using “explode()”

array explode ( string $delimiter , string $string [, int $limit ] )

php also provide the facility to convert array to string and most commonly used method is “implode”

string implode ( string $glue , array $pieces )

e.g lets we have an array of student names and we want to print  Read more…

How to extract the query string parameters.

January 20, 2011 Leave a comment

This was simplest method that i found very much help full, to extract the query string parameters .

  1. <script type=”text/javascript”>
  2. function getParameter(queryString, parameterName){
  3. var parameterName = parameterName + “=”;
  4. if ( queryString.length > 0 ) {
  5. begin = queryString.indexOf ( parameterName );
  6. if ( begin != -1 ) {
  7. begin += parameterName.length;
  8. end = queryString.indexOf ( “&” , begin );
  9. if ( end == -1 ) {
  10. end = queryString.length
  11. }
  12. return unescape ( queryString.substring ( begin, end ) );
  13. }
  14. return “null”;
  15. }
  16. }
  17. /* now we can call this javascript method as follows */
  18. var queryString = window.top.location.search.substring(1);
  19. var urlStr = getParameter(queryString, ‘url’);
  20. </script>

Thanks to mohsin who shared this code with me .

MVC & Php.

December 4, 2010 Leave a comment

Model–View–Controller (MVC) is a software architecture, currently considered an architectural pattern used in software engineering. The pattern isolates “domain logic” (the application logic for the user) from the user interface (input and presentation), permitting independent development, testing and maintenance of each (separation of concerns).

MVC using Php.

There are multiple frameworks/open source  CMS that are using MVC as a architectural patterns e.g. cake php, joomla , etc .

Lets us discuss as much as we can

Cake Php: (http://cakephp.org/)

CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. Using commonly known design patterns like MVC and ORM within the convention over configuration paradigm, CakePHP reduces development costs and helps developers write less code. Read more…

what you know about MVC (architectural pattern)

November 30, 2010 Leave a comment

Model–View–Controller (MVC) is a software architecture, currently considered an architectural pattern used in software engineering. The pattern isolates “domain logic” (the application logic for the user) from the user interface (input and presentation), permitting independent development, testing and maintenance of each (separation of concerns). Read more…

What are design patterns.

November 30, 2010 Leave a comment

In simplest way we can say “Software Engineering best practices for common software Problems”.  A design pattern is a proven design solution to a common problem faced by software developers. Design patterns became popular with the rise of object oriented analysis and design (OOAD).

But most widely used definition for “Design Patterns” is as follows.

“In software engineering, a design pattern is a general repeatable solution to a commonly occurring problem in software design. A design pattern isn’t a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations.” Read more…