background preloader

Web development - The Definitive Guide To Forms based Website Authentication

Web development - The Definitive Guide To Forms based Website Authentication

Solutions: Add InvalidHandler after jQuery validator initialization If you have a problem where you need to add the option 'invalidHandler' to your jqueryValidate (jQuery Validation Plugin) after it has been initialized, this is how it can be done:$(document).ready(function(){ $("#contactForm").bind('invalid-form.validate', function(event, validator) { alert('validation failed!'); } );}); Note: invalidHandler will be called when validation of form fails on submit (e.g. values for a field is missing or such). This might work for other options of the jqueryValidate plugin, but I'm not sure which property to use. I found the property to bind to in the jquery.validate.js file, you might want to look there.

wordnik/swagger-core - GitHub taggable Note: Latest release and documentation are available from extension GitHub page. This extension allows active record model to manage tags. Resources ¶ Discuss Documentation ¶ Taggable Behavior Allows active record model to manage tags. Installation and configuration ¶ Create a table where you want to store tags and cross-table to store tag-model connections. In your ActiveRecord model define behaviors() method: For using AR model for tags (for example, to bind custom behavior), use EARTaggableBehavior. To do it add following to your config: return array( 'import'=>array( 'application.models.*', 'application.components.*', 'ext.yiiext.behaviors.model.taggable.*', ), ); In your AR model implement behaviors() method: function behaviors() { return array( 'tags_with_model' => array( 'class' => 'ext.yiiext.behaviors.model.taggable.EARTaggableBehavior', 'tagTable' => 'Tag', 'tagModel' => 'Tag', ) ); } Methods ¶ setTags($tags) ¶ Replace model tags with new tags set. addTags($tags) or addTag($tags) ¶ getTags() ¶

CActiveRecord Look up a class, method, property or event CActiveRecord is the base class for classes representing relational data. It implements the active record design pattern, a popular Object-Relational Mapping (ORM) technique. Please check the Guide for more details about this class. Protected Methods Hide inherited methods Events Hide inherited events Property Details Returns all column attribute values. commandBuilder Returns the command builder used by this AR. the default database connection for all active record classes. Returns the database connection used by active record. Returns the query criteria associated with this model. Returns if the current record is new. Returns the meta-data for this AR Returns the old primary key value. Returns the primary key value. Returns the table alias to be used by the find methods. Returns the metadata of the table that this AR belongs to Method Details Source Code:framework/db/ar/CActiveRecord.php#210 (show) return parent::__call($name,$parameters);} $this->init();

Working with Databases: Query Builder | The Definitive Guide to Yii | Yii Framework The Yii Query Builder provides an object-oriented way of writing SQL statements. It allows developers to use class methods and properties to specify individual parts of a SQL statement. It then assembles different parts into a valid SQL statement that can be further executed by calling the DAO methods as described in Data Access Objects. The following shows a typical usage of the Query Builder to build a SELECT SQL statement: $user = Yii::app()->db->createCommand() ->select('id, username, profile') ->from('tbl_user u') ->join('tbl_profile p', 'u.id=p.user_id') ->where('id=:id', array(':id'=>$id)) ->queryRow(); The Query Builder is best used when you need to assemble a SQL statement procedurally, or based on some conditional logic in your application. It is not mandatory to use the Query Builder. Note: Query builder cannot be used to modify an existing query specified as a SQL statement. 1. To start using the Query Builder, we create a new instance of CDbCommand as follows, 2. select() 3.

10 Must Read Free Ebooks for Web Designers Web design trends are constantly changing and so is the way information is shared over the web. There are plenty of free e-books that web designers can download to sharpen their skills and stay on top of their game. So, instead of paying for hardcover books, you should first take a look at the free resources available on the web. You might be surprised of how useful these e-books are and of how much great information you can find inside. Since there are a lot of free e-books available on the Internet, here’s a list of the top 10 free e-books that think all web designers should download and read. 1. An accessible guide to good usability and design for beginners and intermediates. 2. If you’re planning to start your own freelance web design business, then you should definitely go through Kevin Airgid’s start-up steps. 3. This guide is very useful for beginner web designers that want to learn how to get started and how to feed their creativity. 4. 5. 6. 7. “Why Design?” 8. 9. 10.

Fallr Git-SVN Low-Risk Practice Assumptions You are supposed to work on a svn branch topic.You hate svn.You want to follow changes of svn trunk.You hate the merging in svn.You already checked out the svn repository with git-svn-clone with stdlayout option. Wrong way First you make a local git branch topic that'll sync with svn branch topic. $ git checkout -b topic topic Then you work on the branch, including git-commit a lot. You sometimes have to see the changes in trunk. $ git checkout master $ git svn rebase And merges the changes into your topic branch. $ git checkout topic $ git merge --no-ff master You know that merge without --no-ff option breaks git-svn system so you did --no-ff. Finally you finished all your work on the topic branch and tried to merge the changes into trunk. $ git checkout master $ git merge --no-ff topic That causes a lot of conflicts that you have to resolve manually. Right way The "Wrong way" example had two failures. ambiguous name of topicmerge from trunk to topic $ git checkout -b tpc topic Next.

Chapter 4. Branch Wizardry Chapter 4. Branch Wizardry Instant branching and merging are the most lethal of Git’s killer features. Problem: External factors inevitably necessitate context switching. Interrupting your train of thought can be detrimental to your productivity, and the more cumbersome it is to switch contexts, the greater the loss. But cloning still entails copying the whole working directory as well as the entire history up to the given point. Solution: Git has a better tool for these situations that is much faster and more space-efficient than cloning: git branch. With this magic word, the files in your directory suddenly shapeshift from one version to another. Ever played one of those games where at the push of a button (“the boss key”), the screen would instantly display a spreadsheet or something? In some directory: $ echo "I'm smarter than my boss" > myfile.txt $ git init $ git add . $ git commit -m "Initial commit" It looks like we’ve just overwritten our file and committed it. and hey presto!

CSS input boxes and submit buttons | CSS button The days of bland web pages with ugly text and layout are long gone, but the parts that make up a form have largely remained unchanged. Here, I am attempting to describe various methods that may be used to enhance the look of your input fields and form buttons. Basic Form A very simple form might look like this: Code <form action=""> Name: <input type="text" /> Password: <input type="password" /> <input type="submit" value="Submit" /> </form> Enhanced Border We can improve on this by firstly changing the border of the form: <form action=""> Name: <input type="text" class="input" /> Password: <input type="password" class="input" /> <input type="submit" value="Submit" class="input" /> </form> Enhanced Background Now we work on the background: <form action=""> Name: <input type="text" class="input" /> Password: <input type="password" class="input" /> <input type="submit" value="Submit" class="button" /> </form> CSS Labels and naming your elements Positioning Hover Effect Using images for buttons

Build seven good object-oriented habits in PHP Make your PHP applications better with object orientation Nathan GoodPublished on October 28, 2008 In the early days of PHP programming, PHP code was limited to being procedural in nature. Procedural code is characterized by the use of procedures for the building blocks of the application. Procedures offer a certain level of reuse by allowing procedures to be called by other procedures. However, without object-oriented language constructs, a programmer can still introduce OO characteristics into PHP code. While purely procedural designs without much modularity run just fine, the advantages of OO design show up in the maintenance. Modularity— one of the key characteristics of good OO design — helps with this maintenance. While there are more than seven habits to building OO software overall, the seven habits here are what you need to make your code fit basic OO design criteria. The seven good PHP OO habits are: Be modest Bad habit: Expose public fields Listing 1. Listing 2. Listing 3.

Howto: Linux Add User To Group How can I add a user to a group under Linux operating system using command line options? How to add an existing user into a group in Linux using command line options? You can use the useradd or usermod commands to add a user to a group. The useradd command creates a new user or update default new user information. The usermod command modifies a user account and it is useful to add user to existing groups. Primary user group.Secondary or supplementary user group. All user account related information are stored in the following files: /etc/passwd – Contains one line for each user account. useradd Example – Add a new user to secondary group You need to the useradd command to add new users to existing group (or create a new group and then add user). developers:x:1124: uid=1122(vivek) gid=1125(vivek) groups=1125(vivek),1124(developers) Please note that capital G (-G) option add user to a list of supplementary groups. useradd example – Add a new user to primary group usermod command options summary

Related: