Upload a File with Zend Framework

What’s the problem of Zend Framework’s file upload approach? As I couldn’t make it work it appears it really isn’t possible to make it work.

Can anyone tell me how to manage this abstraction over the PHP upload process work?

Posted in PHP, zend framework | Tagged , , , , , , , , | 1 Comment

jQuery: what about this.title?

In my last post I was talking about the short way to access the id attribute:

this.id;
this.attr('id'); // this is the same but slower

Beside the most important thing that this is the slower notation, you get also larger notation, which in JavaScript is really pain.

What’s interesting is that you can access almost every attribute of an element with that notation. Take a look at the following example:

<img src="image.jpg" title="test" />

and than

$('element').title

This is much faster and quite nice in place of

$('element').attr('title');
Posted in javascript, micro tutorial | Tagged , , , , , , | 1 Comment

jQuery Get the Id of the Current Element

Useful Tips

Sometimes is really useful not only to read the docs, but to be aware of what the community is writing. Although you get familiar with a library or framework, it happens sometimes to discover very very useful things in them, kind of snippets, that you’ve missed all the time.

In that sense, I’m going to talk about something really small as code in jQuery, but that is quite used. The id selector.

It just so happens that after you discover the selection of an attribute with .attr() method you start selecting even the ids with it.

$('element').attr('id');

Which of course works quite well, but there is a built-in method that has clearer syntax and … better performance – the id.

Think of something like that:

$('element').click(function() {
    alert($(this).attr('id'));
}

It can be replaced with:

$('element').click(function() {
    alert($(this).id);
}

It’s cool!

Posted in web development | Tagged | 10 Comments

Protect Your Web Forms with Zend_Service_Akismet

Akismet

If you’re a typical WordPress blogger you have definitely heart of Akismet, tool that gives you a real spam protection, but what is really really cool is the possibility to integrate Akismet via Zend Framework.

It’s pretty simple. There’s a service by Zend_Service_Akismet, which helps you a lot when integrating the Akismet in your Zend app.

That’s for now, but I’ll be definitely writing more and more on the topic.

Posted in web development, zend framework | Leave a comment

Vendor Prefixes in CSS

Vendor Prefixes vs CSS3

Either are bad, because vendor prefixes work on specific browsers, while CSS3 is not implemented fully by those browsers. When talking about vendor prefixes in CSS, let me tell you in breve, what’s this. If you’d like to make rounded corner under Mozilla Firefox, you usually use a background image, but there’s another way to do it – with Mozilla specific CSS:

-moz-border-radius: 5px;

That’s bad because it works only on Mozilla based browsers, although there’s a webkit based similar syntax:

-webkit-border-radius: 5px;

Even after that our “favorite” browser MSIE until version 9 is not displaying any rounded corners.

In other hand CSS3 gives us the possibility to write the simple:

border-radius:5px;

which is not implemented in many currently used browsers, but it may be used for progressive enhancements.

In Breve …

Everybody’s talking about vendor prefixes after the famous post of PPK, but there are both opinions – pros and cons. However it’s good to use it, but very carefully, and think about what CSS3 may give you!

Posted in css | Tagged , , , , , , , | Leave a comment