Jump to content

qtguru

Members
  • Posts

    356
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by qtguru

  1. Lol I have a good job, I am just looking to showcase my skill and I guess inspire people. Yeah it's just for fun and showcasing my thoughts. Hopefully as time goes by, there would be much more content to share.
  2. Lol yes I am not sure what I was thinking when I did the navigation, I guess I got too carried away after looking at awwwards and dribbble. I will work on that Hmmmm this is a very interesting point, So what I aim to achieve is to have a website, where I can share my works, concepts and any crazy idea that comes to mind. I still have so much content to populate the site with, I tend to research and write things down, so I want to use my site as an avenue to share my works. Because I have been told by colleagues that I need to showcase my works and ideas more and also participate in community projects too. That's my goal. I won't mind any advice. Thanks and good to be back.
  3. Hi guys, so since I moved to Processwire, it has been my default go-to CMF/CMS for my website and client applications, apparently my previous job took a toll on me, and made me have less time, but now finally had the chance to change my website to something I always had in mind. I decided to go with something minimal, as I tend to enjoy writing, so wanted a website to have more text than graphics and I think I whipped up something clean. Currently I still have more to do, but this is my current website, the main purpose to have a content driven website where I will be writing tutorials , articles more and hopefully technical notes. Please let me know your honest opinion. PS: I am more of a coder than a designer but i think this old dog still pulled it off https://okeowoaderemi.com/
  4. Processwire API and minimalism is so much lean that it feels like you are still writing PHP compared to other CMS which are overly complex, I think Processwire is easy to use Project with so many things taken care of, especially the fields, It's so much easier to build applications for client easily than other frameworks/cms because Processwire provides so many features that are vital.
  5. have you covered this ? Enabling Pagination Make sure the "Pager" (MarkupPagerNav) module is installed in Admin > Modules. If it's not installed, click the Install link next to it. Determine what template(s) you want to use pagination with. Go to Admin > Setup > Templates > [Your Template] > URLs, and check the box for: Allow Page Numbers. Save. Pagination should now be enabled and ready to use in your templates.
  6. Hi you might call it dumb, but this is actually interesting, I was thinking is there any mechanism to /condition to stop a Hook from being called, so pardon this jargon, so I took the time to see if such exists public function runHooks($method, $arguments, $type = 'method') { $result = array( 'return' => null, 'numHooksRun' => 0, 'methodExists' => false, 'replace' => false, ); $realMethod = "___$method"; if($type == 'method') $result['methodExists'] = method_exists($this, $realMethod); if(!$result['methodExists'] && !self::isHooked($method . ($type == 'method' ? '()' : ''))) { return $result; // The condition for not running is when not hooked or method doesn't exist } $hooks = $this->getHooks($method); foreach(array('before', 'after') as $when) { if($type === 'method' && $when === 'after' && $result['replace'] !== true) { if($result['methodExists']) { $result['return'] = call_user_func_array(array($this, $realMethod), $arguments); } else { $result['return'] = null; } } foreach($hooks as $priority => $hook) { if(!$hook['options'][$when]) continue; if(!empty($hook['options']['objMatch'])) { $objMatch = $hook['options']['objMatch']; // object match comparison to determine at runtime whether to execute the hook if(is_object($objMatch)) { if(!$objMatch->matches($this)) continue; } else { if(((string) $this) != $objMatch) continue; } } if($type == 'method' && !empty($hook['options']['argMatch'])) { // argument comparison to determine at runtime whether to execute the hook $argMatches = $hook['options']['argMatch']; $matches = true; foreach($argMatches as $argKey => $argMatch) { $argVal = isset($arguments[$argKey]) ? $arguments[$argKey] : null; if(is_object($argMatch)) { // Selectors object if(is_object($argVal)) { $matches = $argMatch->matches($argVal); } else { // we don't work with non-object here $matches = false; } } else { if(is_array($argVal)) { // match any array element $matches = in_array($argMatch, $argVal); } else { // exact string match $matches = $argMatch == $argVal; } } if(!$matches) break; } if(!$matches) continue; // don't run hook } $event = new HookEvent(); $event->object = $this; $event->method = $method; $event->arguments = $arguments; $event->when = $when; $event->return = $result['return']; $event->id = $hook['id']; $event->options = $hook['options']; $toObject = $hook['toObject']; $toMethod = $hook['toMethod']; if(is_null($toObject)) $toMethod($event); else $toObject->$toMethod($event); $result['numHooksRun']++; if($when == 'before') { $arguments = $event->arguments; $result['replace'] = $event->replace === true || $result['replace'] === true; if($result['replace']) $result['return'] = $event->return; } if($when == 'after') $result['return'] = $event->return; } } return $result; } As you can see there isn't any logic to stop hooks from running other than if the arguments are wrong and method doesn't exist or the method itself in question is not hookable. However using an exit should work since the exit method stop the execution of the current script. I think the concept of Hooks is you attaching to them and not stopping them. But another alternative would be to remove the check from the hook and and have the check determining whether to call the WireHttp::send Let me know if that suffices
  7. Oops I get the confusion now, sorry my fault I assumed it was the same when i saw horst name here is the link:
  8. Sorry I was referring to topic you posted, the author there had an issue making PATCH Request using WireHttp, I was only pointing that out should you encounter such.
  9. Horst beat me to it, WireHttp is basically a wrapper around CURL, However that thread you linked, pointed out something about making a PATCH Request.
  10. Out of curiosity, can you dump the data being sent out and validate it's the proper data you intend to send also this stackoverflow also details a way of making PATCH curl calls. https://stackoverflow.com/questions/14451401/how-do-i-make-a-patch-request-in-php-using-curl
  11. I have written tutorials here and various tutorials before, it's fun for me however I think starting small is a good idea. I will create a thread for this today or tomorrow where we can deliberate on table of contents and all.
  12. I don't know if this is in works, because I have much free time ( Change of Job) , I am thinking of picking this up, using something that generates from Markdown via Github, I have looked at Leanpub, @HMC is right, a table of content is necessary, I will create a thread for this, because I think it is long due for this. However I will prefer somewhere , where people can edit and push for changes, Git seems to fit for this purpose if anyone has any comments, please feel free to chime in.
  13. Here is a link to the source of my website, I used Twig for it, I will try and create a repo for this, this week https://github.com/dojoVader/My-Website/blob/master/remipw-next
  14. That's not a bad idea, I love writing tutorial and that thought has always been there, maybe it is something I can look at except that payment issues is one that discourages me from sure since my country has so many restrictions, but it is something that is due. A book someone can follow from scratch to finish. Good idea
  15. I have been absent in the PW scene, I am still curious about this ChangeLog i think it's long due, is there a repo on it ? or anyone working on it, so i can contribute.
  16. {block name="content"}{/block} Sorry about that, that was a smarty template, my brain went into Smarty mode the correct syntax is what you provided, in your layout where you arr inheritting from, ensure you have something like this {% block content %} {% endblock %}
  17. qtguru

    Nexoc Notebooks

    How i think i might need a new laptop for gaming. nice site. My Nvidia 830M is outdated
  18. function insert($data) { $this->site->pages->find(....); // <= use the site through the class handle } The problem i find with this, is that now your class knows too much about the site pages, it would be better to simply pass the data, else this would lead to tight coupling, unless you have to create an interface and ensure the contracts are followed.
  19. Lol I write Java in the office so i make the mistake of fusing Java into PHP.
  20. So the reason for uses Classes, is that you want to hide complexity and just expose the method in a clean manner, and also you want to deal with properties internally without side effects as you would when doing procedural type of coding. So if you want to pass any data to your classes, there are multiple ways but the best way is to always pass the data by copy in either constructor like this <?php class Submisssion{ private data; __construct(data){ $this->data=data } } or using a Setter method <?php class Submission { private data; public function insert($data){ $this->data = $data; } $submission->insert($data); What this does is pass the data through a method and achieves the same as the constructor, because this way the Submission class can handle manipulation of data without external change outside the class. Which is why OOP is usually preferred as alot of things are hidden and the methods are made simple so you can use a Class without having to read the internal details.
  21. You need insight and analytics, whne you say it's slow is it as a result of time to render on the client, or do you mean time a method or function takes, you will need a profiler for both frontend and the backend to have more detailed information. https://sandro-keil.de/blog/2015/02/10/php-profiling-tools/
  22. Oh i see what you mean, an external plugin that adds to the column without altering the data , Hmm I will look at the documentation more. I think i get now
  23. Glad to hear JeevanisM, even recently I was thinking of a Github open book about Processwire, but I am somehow a bit of a procrastinator sometimes, I guess I will map out something for that.
  24. I maybe be wrong but it seems, you want to render a certain info based on the data provided, ideally most Table give options to enable you have power over the rendering process. Does this satisfy your feat, and also it's like a plugin too https://www.ag-grid.com/javascript-grid-cell-rendering-components/
×
×
  • Create New...