PHP - Moved: Which Is Better Php Web Framework ? (codeigniter,zend Framework,cakephp,symfony)
This topic has been moved to Other Libraries and Frameworks.
http://www.phpfreaks.com/forums/index.php?topic=347122.0 Similar TutorialsThis topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=324009.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=328743.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=319964.0 I have spent the last few days going over Zend framework 2, and I am finding it extremely complex. Not saying it shouldn't be, but it seems to solve problems I never have come across (so to speak) .
For instance:
Routing is super complex. I usually use torophp - which is simple & gets the job done.
Dependency injection - example of problem I have never come across.
My motivations for learning zend, are -
1. To write modular reuseable code.
2. Learn advanced / modern PHP , as far as frameworks are concerned I just know codeigniter.
3. A framework with good long term support.
Is there some other framework that is easier to learn ? and that would satisfy my requirements ?
I have been programming in PHP for the last 2-3 years btw, so I know my way around
Thanks
Edited by nik_jain, 31 August 2014 - 09:56 AM. As a long time CodeIgniter user, I made the decision to move away from CodeIgniter a while back. I still maintain, and in some cases develop new features for websites that I made using CodeIgniter.
Still somewhat active in the CodeIgniter forum, I have seen a recent question, "How do we get CodeIgniter back to the PHP framework of choice?". I have offered my own criticism of the framework, but the thread is located on the CodeIgniter forum, so many just protect their beloved CI, not willing to accept that it is in great need of change.
I would appreciate if phpfreaks members would be critical, and hopefully specific in regards to CodeIgniter's problems. I intend to link to this thread, with the hopes that your opinions will help future development of CodeIgniter. Thank you.
I can't figure out how to optimize my Zend framework performance. My query executes in 200ms but my page is taking almost 60 seconds to load. While checking the zend toolbar it shows that my page size is 14mb and I don't know why. The routes and options size is really large but I don't know what is causing this. Any ideas?
To see the full breakdown:
http://awesomescreen....com/0c73vewycc
I don't think php is installed/enabled?! This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=327717.0 This topic has been moved to Application Frameworks. http://www.phpfreaks.com/forums/index.php?topic=317468.0 This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=332538.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=322256.0 I wirte php... do i use a framework?.. if so what framework do i use?... When i do phpinfo(); ... i get a screen that says: This program makes use of the Zend Scripting Language Engine: so do i use the zend framework? regards J Hi, I'm trying to write my own php mvc framework, but I don't know where to start. I have been using codeigniter for a while, then i thought i shouldn't use it, because I'm not getting smarter when most of the code is written for me. So, writting my own framework would be a great practice to learn oop, i guess. I need: url routing, the would work like codeigniter's (http://website.com/controller/method/some/other/params) and calling some function for rendering layout files similar to codeigniter's ($this -> load -> view ( 'file.php' ); and not like this: $header = new Template ( 'header.php' ); then some coding with header, and same with content.php and footer.php). Can anyone please help me? Where to start? sorry for bad English Hi, I have been doing small scale programming but I am now planning to foray into large scale, intensive web application to handle high traffic, definitely I need something fast, efficient and re-usable. Since I am programming for a while, I have my own collection of code which I use for base and generally am able to build fast and secure (small) web application. But now I am looking into framework. So, here is the question.. Should I look into framework like Yii , Kohana etc.. or Should continue building on my own code .. I just don't want to learn all those framework if and but then at the decides not to use them as I find them not really helpful !!! Okay, this is a head scratcher for me... About 10-15 years ago, there was this framework that seemed to be pretty popular in the LAMP work for quickly building websites. (I think it was written in PHP.) The thing I recall about it was that it you could create your own markup tags to markup up fields using curly brackets { }. I wish I could be more specific but this is all that is coming to mind. Any clues of what I might be thinking about? Hello guys, okay? hey guys im after a bit of advise on routing within my framework please.
now i've created a route:
account/verify/email-address/:email_address/activation-key/:activation_key
which will be then interpurated into
account/verify/email-address/destramic-at-hotmail-dot-com/activation-key/12345
now my question is having a email address in a url is good idea?
if so i can decode the :email_addres parameter in the route like so:
$router->add_route('account/verify/email-address/:email_address/activation-key/:activation_key', array('controller' => 'users', 'action' => 'activate_account', 'decode' => 'email_addres' => 'string_to_email') ));would like your thoughts on this please guys (go easy)...if not a user_id would be sufficient i suppose thanks hey guys im having a bit of trouble getting $_GET in my framework. now the ony way to get query from a url such as:
users/activate-account?email_address=test&token=test
i have to use $_SERVER['REQUEST_URI'] unless im doing something wrong?
[REQUEST_URI] => /bisi/user/activate-account?email_address=test&token=test
by doing this:
print_r($_GET);all i get is : Array ( [uri] => user/activate-account ) just concerned im doing something wrong?...any advise on this please guys. was thinking of doing something like this in my request public function get_query($name = null) { $uri = $_SERVER['REQUEST_URI']; if (parse_url($uri, PHP_URL_QUERY)) { $query = explode("?", $uri); $query = explode("&", $query[1]); $array = array(); foreach ($query as $string) { $string = explode("=", $string); $query_name = $string[0]; $query_value = $string[1]; $array[$query_name] = $query_value; // $_GET[$query_name] = $query_value; possibly? } if ($name !== null && array_key_exists($name, $array)) { return $array[$name]; } return $array; } return null; }thanks Lol! Ok let's see... index.php <?php /* index.php this file will be under /var/www/site/public_html or some other public dir */ //this will look into ../application //you can do something like /var/www/site/application if you want define("APP_PATH", __DIR__ . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "application" . DIRECTORY_SEPARATOR); define("LIB_PATH", APP_PATH . "lib" . DIRECTORY_SEPARATOR); //This is because we don't want direct access to files, we'll be checking in every private file //if this is defined define("O_FRAMEWORK", "Bla bla bla"); //Had to make theese variable because i had some problems with the require_once when using constants + strings, i'll fix this soon $config_path = APP_PATH . "config.php"; $router_path = LIB_PATH . "Router.php"; $front_path = LIB_PATH . "Front.php"; require_once($config_path); require_once($front_path); require_once($router_path); if(isset($autoload)){ if(!autoload($autoload)){ echo "zzz"; exit(); //Errors when trying to open files... } } $router = new Router(); if($router->isRouteValid() == false){ echo "404"; exit(); //Didn't find route } $front = new Front(); $front->servePage($router->getRoutePath()); //This part of code should probably be optimized... function autoload($autoload) { for($i = 0; $i < sizeof($autoload); $i++){ if(!file_exists(APP_PATH . $autoload[$i] . ".php")) return false; require_once($autoload[$i] . ".php"); } return true; } ?> Front.php <?php /* Front.php Ok hm... this is very uncomplete :/ */ if(!defined("O_FRAMEWORK")){ echo "Direct file access forbidden"; exit();} define("CONTROLLER_PATH", APP_PATH . "controllers" . DIRECTORY_SEPARATOR); class Front { public function __construct(){} public function servePage($routePath) { if(strpos("/", $routePath)){ //Will do this later :P } else { $controller_name = $routePath; $method = "index"; } require_once(CONTROLLER_PATH . $controller_name . ".php"); $controller = new $controller_name(); $controller->$method(); } } ?> Router.php <?php /* Router.php */ if(!defined("O_FRAMEWORK")){ echo "Direct file access forbidden"; exit();} class Router { private $_route; private $_available_routes = array ( "Homepage" => "/", ); private $_route_path; public function __construct() { $this->_route = $_SERVER["REQUEST_URI"]; } public function getRoute() { return $this->_route; } public function getRoutePath() { return $this->_route_path; } public function isRouteValid() { foreach($this->_available_routes as $route){ if($this->_route == $route){ $this->_route_path = array_keys($this->_available_routes, $route, true); $this->_route_path = $this->_route_path[0]; return true; } } return false; } } ?> config.php <?php //This is empty atm ?> Homepage.php (this is the home controller) <?php if(!defined("O_FRAMEWORK")){ echo "Direct file access forbidden"; exit();} class Homepage { public function __construct(){} public function index() { echo "Homepage"; } } ?> This is what i got, it's all messed up but i'll fix it soon |