Archive

Posts Tagged ‘Framework’

Let’s get started with jQuery

February 27th, 2009 No comments

Nowadays you may see tons of Javascript frameworks coming up. The truth is that it makes your code efficient if a framework used instead of pure javascript code. Most of the javascript frameworks helps you to solve crossbrowser difficulties. Probably you heard about Prototype and MooTools. You may see some people are trying to decide between these frameworks. I should say i am fan of jQuery. jQuery comes with tons of futures and flexibility and you can do a big work with less effort and it is not just a regular library however jQuery is even ajax and effect library. It does evertything i need with piece of code.

jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.

Let’s say you are using some other libraries as well, there it goes, jQuery is such a good friend with other libraries. API designed with conciseness and convenience as the driving factors.

Before start with jQuery i want you to know some basics about it. You can download the framework basically from www.jquery.com then download it on your desktop. This is how jQuery places in html code.

<html>
<head>
<strong><script type="text/javascript" src="jquery.js"></script></strong>
<script type="text/javascript">
<strong>// Your code goes here</strong>
</script>
</head>
<body>
<a href="http://jquery.com/">jQuery</a>
</body>
</html>

You can start with placing your core *.js file which is jquery.js for this example.

Read more…

VN:F [1.9.22_1171]
Rating: 4.0/10 (6 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Categories: General, Jquery, PHP, Programming Tags: , , ,

CodeIgniter How to Pagination

November 12th, 2008 3 comments

CodeIgniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications. If you’re a developer who lives in the real world of shared hosting accounts and clients with deadlines, and if you’re tired of ponderously large and thoroughly undocumented frameworks.

CodeIgniter’s Pagination class is very easy to use, and it is 100% customizable, either dynamically or via stored preferences.

If you are not familiar with the term “pagination”, it refers to links that allows you to navigate from page to page, like this:

« First < 1 2 3 4 5 > Last »

function shownews()
{
if($this->userlib->logged_in()) 
//checking for security purposes
{
$this->load->library('pagination');
$per_page = 10; 
// How many pages you want to show in each page
$total = $this->db->get('posts', $per_page, $this->uri->segment(3)); 

//Here is the most important part actually. 
Basically $total variable determined which 
rows you are going to show in the page

$config['base_url'] = base_url().'/index.php/admin/shownews';
$config['total_rows'] = $this->db->count_all('posts'); // Count total rows in the query
$config['per_page'] = $per_page;
$config['num_links'] = 6;
$this->pagination->initialize($config);
$data['posts'] = $total;
$this->load->view('admin_shownews', $data);
} else {
$this->load->view('admin_logineed');
}
}

After getting done with this configuration part of pagination class all you have to do is just initialize it like you are doing it in most of programming languages.

Read more…

VN:F [1.9.22_1171]
Rating: 7.1/10 (41 votes cast)
VN:F [1.9.22_1171]
Rating: -1 (from 5 votes)