Coding right, tips
Friday, August 21st, 2009I stumbled upon this when searching for something about code, enjoy!
site: freevbcode
I stumbled upon this when searching for something about code, enjoy!
site: freevbcode
I’m attached to codeigniter, I know my way around but codeigniter as a a easy to use but now I want something more darring and so this is it, Symfony framework, I think I’ll be doing that in my vacation that starts in about a week
I must admit that I not a huge fan of Frameworks and Patterns because:
A) They make things complicated
B) Subject you to some nasty code stuff and rules
C) Because templating and Frameworks can be water and fire.
Codeigniter on the opposite has some advantage on it side for the templating stuff. This is really a short explanation for a common problem in other framework.
What to do if you want a nice folder structure or have different template styles, remember this is just a basic thing which happen to work in CI 1.7.
function index(){
$this->load->view('Themename/news/index);
}
Just add some slashes an it works so normally it should work if you would make an adaptation for themes too with a variable in it.
The next thing was kind of hard to find on the web so let me share it. It’s for when you develop with CI and your not working in the root directory of your server.
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]
I’ve grew bored of having to deal with some irritating PHP issues so I’ve turned my back to those and began testing codeIgniter. It seems strait forward but templating already has me intrigued with problems and mod_rewrite needs a look too I think :p .